Class WbeFileLock


  • public class WbeFileLock
    extends Object
    This class permits to handle Web Browser Edition file locking from point of view of the HOST.

    When a lock is set, it is alive for 30 minutes.

    Author:
    silveryocha
    • Constructor Detail

      • WbeFileLock

        protected WbeFileLock()
    • Method Detail

      • id

        public String id()
        Gets the identifier of the lock if any.
        Returns:
        a string if any, empty string if none or if the lock timer is over.
      • setId

        public void setId​(String id)
        Sets a new lock identifier.

        The lock timer is set with OffsetDateTime.now().

        Parameters:
        id - a lock identifier.
      • clear

        public void clear()
        Clears the lock identifier and the associated timer.
      • exists

        public boolean exists()
        Indicates if a lock exists.

        Even if setId(String) or clear() have not been called, if lock timer is over, no lock is concidered.

        Returns:
        true if exists, false otherwise.