Class AccessPermissions

  • All Implemented Interfaces:
    java.io.Serializable

    public class AccessPermissions
    extends java.lang.Object
    implements java.io.Serializable
    Represents access permissions for virtual file.

    The following is an example of AccessPermissions class

        AccessPermissions permissions = new AccessPermissions(); // Permission of the virtual file name
        permissions.setDirectoryDeletionAllowed(false);
        permissions.setFileDownloadingAllowed(false);
        permissions.setFileUploadingAllowed(false);
    
        // Creates a VirtualLocalFile and give some permissions
        VirtualLocalFile vp = new VirtualLocalFile(virtualFileName,permissions,realFileName);
    
     
    Author:
    Alex Usun
    See Also:
    Serialized Form
    • Constructor Detail

      • AccessPermissions

        public AccessPermissions​(boolean fileDownloadingAllowed,
                                 boolean fileUploadingAllowed,
                                 boolean fileOverwritingAllowed,
                                 boolean fileDeletionAllowed,
                                 boolean fileAppendingAllowed,
                                 boolean fileListingAllowed,
                                 boolean fileRenamingAllowed,
                                 boolean fileSharingAllowed,
                                 boolean directoriesListingAllowed,
                                 boolean directoryMakingAllowed,
                                 boolean directoryDeletionAllowed,
                                 boolean subdirectoriesBrowsingAllowed)
      • AccessPermissions

        public AccessPermissions()
        Creates a new permissions instance.
      • AccessPermissions

        public AccessPermissions​(AccessPermissions that)
        Copy constructor.
        Parameters:
        that - instance to copy
    • Method Detail

      • isFileDownloadingAllowed

        public boolean isFileDownloadingAllowed()
        Checks if the user is allowed to download files from the current directory.
        Returns:
        true if the user is allowed to download files; false otherwise
      • setFileDownloadingAllowed

        public void setFileDownloadingAllowed​(boolean value)
        Sets the ability to download files from the current directory.
        Parameters:
        value - if true the user is allowed to download files from the current directory
      • isFileUploadingAllowed

        public boolean isFileUploadingAllowed()
        Checks if the user is allowed to upload files to the current directory.
        Returns:
        true if the user is allowed to upload files; false otherwise
      • setFileUploadingAllowed

        public void setFileUploadingAllowed​(boolean value)
        Sets the ability to upload files to the current directory.
        Parameters:
        value - if true the user is allowed to upload files to the current directory
      • isFileOverwritingAllowed

        public boolean isFileOverwritingAllowed()
      • setFileOverwritingAllowed

        public void setFileOverwritingAllowed​(boolean value)
      • isFileDeletionAllowed

        public boolean isFileDeletionAllowed()
        Checks if the user is allowed to delete files from the current directory.
        Returns:
        true if the user is allowed to delete files; false otherwise
      • setFileDeletionAllowed

        public void setFileDeletionAllowed​(boolean value)
        Sets the ability to delete files from the current directory.
        Parameters:
        value - if true the user is allowed to delete files from the current directory
      • isFileAppendingAllowed

        public boolean isFileAppendingAllowed()
        Checks if the user is allowed to append files in the current directory.
        Returns:
        true if the user is allowed to append files; false otherwise
      • setFileAppendingAllowed

        public void setFileAppendingAllowed​(boolean value)
        Sets the ability to append files in the current directory.
        Parameters:
        value - if true the user is allowed to append files in the current directory
      • isFileListingAllowed

        public boolean isFileListingAllowed()
        Checks if the user is allowed to list files in the current directory.
        Returns:
        true if the user is allowed to list files; false otherwise
      • setFileListingAllowed

        public void setFileListingAllowed​(boolean value)
        Sets the ability to list files in the current directory.
        Parameters:
        value - if true the user is allowed to list files in the current directory
      • isFileRenamingAllowed

        public boolean isFileRenamingAllowed()
        Checks if the user is allowed to rename files in the current directory.
        Returns:
        true if the user is allowed to rename files; false otherwise
      • setFileRenamingAllowed

        public void setFileRenamingAllowed​(boolean value)
        Sets the ability to rename files in the current directory.
        Parameters:
        value - if true the user is allowed to rename files in the current directory
      • isFileSharingAllowed

        public boolean isFileSharingAllowed()
        Checks if the user is allowed to share files in the current directory.
        Returns:
        true if the user is allowed to share files; false otherwise
      • setFileSharingAllowed

        public void setFileSharingAllowed​(boolean value)
        Sets the ability to share files in the current directory.
        Parameters:
        value - if true the user is allowed to share files in the current directory
      • isDirectoriesListingAllowed

        public boolean isDirectoriesListingAllowed()
        Checks if the user is allowed to list subdirs in the current directory.
        Returns:
        true if the user is allowed to list subdirs; false otherwise
      • setDirectoriesListingAllowed

        public void setDirectoriesListingAllowed​(boolean value)
        Sets the ability to list subdirs in the current directory.
        Parameters:
        value - if true the user is allowed to list subdirs in the current directory
      • isDirectoryMakingAllowed

        public boolean isDirectoryMakingAllowed()
        Checks if the user is allowed to make directories in the current directory.
        Returns:
        true if the user is allowed to make directories; false otherwise
      • setDirectoryMakingAllowed

        public void setDirectoryMakingAllowed​(boolean value)
        Sets the ability to make directories in the current directory.
        Parameters:
        value - if true the user is allowed to make directories in the current directory
      • isDirectoryDeletionAllowed

        public boolean isDirectoryDeletionAllowed()
        Checks if the user is allowed to delete directories in the current directory.
        Returns:
        true if the user is allowed to delete directories; false otherwise
      • setDirectoryDeletionAllowed

        public void setDirectoryDeletionAllowed​(boolean value)
        Sets the ability to delete directories in the current directory.
        Parameters:
        value - if true the user is allowed to delete directories in the current directory
      • isSubdirectoriesBrowsingAllowed

        public boolean isSubdirectoriesBrowsingAllowed()
        Checks if the user is allowed to browse subdirs in the current directory.
        Returns:
        true if the user is allowed to brows subdirs; false otherwise
      • setSubdirectoriesBrowsingAllowed

        public void setSubdirectoriesBrowsingAllowed​(boolean value)
        Sets the ability to browse subdirs in the current directory.
        Parameters:
        value - if true the user is allowed to browse subdirs in the current directory
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object