getFileModeForFile(File file) Utility to create a FileMode object given a File.
For this to be effective, a FileModeHandler must have been
registered using FileUtil.setFileModeHandler.
Utility to create a FileMode object given a File.
For this to be effective, a FileModeHandler must have been
registered using FileUtil.setFileModeHandler. If no
FileModeHandler is registered, or the registered one
throws an excepion then the FileMode is obtained
using the native File.canRead and File.canWrite
methods. This will NOT take into account 'group' and 'other'
file mode types and 'execute' permission. *
Parameters: file - file to based FileMode on FileMode object
Return a file mode object given a string
Parameters: string - string representation of the file mode file mode
getFileModeTypeForMnemonic
public static FileModeType getFileModeTypeForMnemonic(char mnemonic)(Code)
Return a file mode type given its mnemonic
Parameters: fileModeType - Parameters: fileModePermission -
getPermission
public FileModePermission[] getPermission(FileModeType type)(Code)
Get the permissions for a given file mode type
Parameters: fileModeType - file mode type permissions
getPermissionsForString
public static FileModePermission[] getPermissionsForString(String s)(Code)
Return an array of FileModePermission's given a string.
Each character in the string will be examined for the mnemonic of the
three know permission read,write and execute
Parameters: string - representation of the permission array of permission object
hasPermission
public boolean hasPermission(FileModeType fileModeType, FileModePermission fileModePermission)(Code)
Determine if a FileMode has a particular permission set
Parameters: fileModeType - Parameters: fileModePermission - true if file has permission
permissionsToString
public static String permissionsToString(FileModePermission[] permissions)(Code)
Return how an array of permissions would be represented as a string
Parameters: fileModePermission - array of permissions as a string
removePermission
public void removePermission(FileModeType fileModeType, FileModePermission fileModePermission)(Code)
Remove a permission.
Parameters: fileModeType - Parameters: fileModePermission -
Utility to set a file given a FileMode specify what
permissions should be set
Parameters: fileMode - file mode object Parameters: file - file to set mode on throws: IOException -
setPermission
public void setPermission(FileModeType fileModeType, FileModePermission[] fileModePermission)(Code)
Set the permissions for a given FileModeType.
Parameters: fileModeType - file mode type Parameters: fileModePermission - file mode permission