Interface to allow locking files in home directory

Java always tries to lock this file before using Preferences feature:

/home/saeid/.java/.userPrefs/.user.lock.saeid

I tried using personal-files interface:

plugs:
  java-preferences:
    interface: personal-files
    read:
      - $HOME/.java/.userPrefs/.user.lock.saeid
    write:
      - $HOME/.java/.userPrefs/.user.lock.saeid

But it didn’t work. I can read the file but I can’t lock it. Is there an interface for locking files? or do I need to request classic access for my app?