Class SkinLockManager

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role name
    • Method Detail

      • canWrite

        public boolean canWrite​(Path file)
                         throws IOException
        Determines if the current user can write in skin directory
        Parameters:
        file - The skin directory
        Returns:
        true if the skin directory is not locked by another user
        Throws:
        IOException - If an error occurred
      • updateLockFile

        public void updateLockFile​(Path file,
                                   String toolId)
                            throws IOException
        Create or update .lock file
        Parameters:
        file - The skin directory
        toolId - The id of tool responsible for lock.
        Throws:
        IOException - If an error occurred
      • unlock

        public void unlock​(Path file)
        Remove lock file
        Parameters:
        file - The skin directory
      • isLocked

        public boolean isLocked​(Path file)
        Determines if the skin directory is locked
        Parameters:
        file - The skin directory
        Returns:
        true if the skin directory is locked
      • getLockTool

        public String getLockTool​(Path file)
                           throws IOException
        Get tool responsible for lock
        Parameters:
        file - The skin directory
        Returns:
        The tool responsible for lock or null
        Throws:
        IOException - if an error occurs while manipulating files
      • lastModified

        public Date lastModified​(Path file)
                          throws IOException
        Get the last modified date
        Parameters:
        file - The skin directory
        Returns:
        the last modified date
        Throws:
        IOException - if an error occurs while manipulating files