java.lang.Object
coneforest.psylla.core.PsyFileSystem
An utility class providing filesystem-related methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextActionContext action of thechangefilepermissionsoperator.static final ContextActionContext action of thecopyfileoperator.static final ContextActionContext action of thecreatedirectoryoperator.static final ContextActionContext action of thecurrentdirectoryoperator.static final ContextActionContext action of thedeletefileoperator.static final ContextActionContext action of thefileaccesstimeoperator.static final ContextActionContext action of thefileattributeoperator.static final ContextActionContext action of thefilecreationtimeoperator.static final ContextActionContext action of thefileexistsoperator.static final ContextActionContext action of thefilemodifiedtimeoperator.static final ContextActionContext action of thefilepermissionsoperator.static final ContextActionContext action of thefilesoperator.static final ContextActionContext action of thefilesizeoperator.static final ContextActionContext action of thehardlinkoperator.static final ContextActionContext action of theisdirectoryoperator.static final ContextActionContext action of theisfileoperator.static final ContextActionContext action of theissamefileoperator.static final ContextActionContext action of theissymlinkoperator.static final ContextActionContext action of thereadlinkoperator.static final ContextActionContext action of therenamefileoperator.static final ContextActionContext action of thesymlinkoperator. -
Method Summary
Modifier and TypeMethodDescriptionstatic PathgetPath(PsyTextual oFileName) static voidpsyChangeFileAttribute(PsyTextual oFileName, PsyTextual oAttribute, PsyObject oValue) static voidpsyChangeFilePermissions(PsyTextual oFileName, PsyInteger oPermissions) static voidpsyCopyFile(PsyTextual oSourceName, PsyTextual oTargetName) Copies a file to the target file.static voidpsyCreateDirectory(PsyTextual oFileName) Creates a new directory with the given name.static PsyNameReturns anamerepresenting the absolute name of the current directory.static voidpsyDeleteFile(PsyTextual oFileName) Deletes a file or empty directory with a given name.static PsyNamepsyFileAbsolutePath(PsyTextual oFileName) Returns anamerepresenting the absolute path to given file.static PsyIntegerpsyFileAccessTime(PsyTextual oFileName) static PsyObjectpsyFileAttribute(PsyTextual oFileName, PsyTextual oAttribute) static PsyIntegerpsyFileCreationTime(PsyTextual oFileName) static PsyBooleanpsyFileExists(PsyTextual oFileName) static PsyIntegerpsyFileModifiedTime(PsyTextual oFileName) static PsyIntegerpsyFilePermissions(PsyTextual oFileName) static PsyFormalStream<PsyName>psyFiles(PsyTextual oFileName) static PsyIntegerpsyFileSize(PsyTextual oFileName) Returns theintegerrepresenting the size (in bytes) for the file or directory with the given name.static voidpsyHardlink(PsyTextual oFileName1, PsyTextual oFileName2) static PsyBooleanpsyIsDirectory(PsyTextual oFileName) static PsyBooleanpsyIsFile(PsyTextual oFileName) static PsyBooleanpsyIsSameFile(PsyTextual oFileName1, PsyTextual oFileName2) static PsyBooleanpsyIsSymlink(PsyTextual oFileName) static PsyNamepsyReadLink(PsyTextual oFileName) static voidpsyRenameFile(PsyTextual oFileName1, PsyTextual oFileName2) static voidpsySymlink(PsyTextual oFileName1, PsyTextual oFileName2)
-
Field Details
-
PSY_CHANGEFILEPERMISSIONS
Context action of thechangefilepermissionsoperator. -
PSY_COPYFILE
Context action of thecopyfileoperator. -
PSY_CREATEDIRECTORY
Context action of thecreatedirectoryoperator. -
PSY_CURRENTDIRECTORY
Context action of thecurrentdirectoryoperator. -
PSY_DELETEFILE
Context action of thedeletefileoperator. -
PSY_FILEACCESSTIME
Context action of thefileaccesstimeoperator. -
PSY_FILEATTRIBUTE
Context action of thefileattributeoperator. -
PSY_FILECREATIONTIME
Context action of thefilecreationtimeoperator. -
PSY_FILEEXISTS
Context action of thefileexistsoperator. -
PSY_FILEMODIFIEDTIME
Context action of thefilemodifiedtimeoperator. -
PSY_FILEPERMISSIONS
Context action of thefilepermissionsoperator. -
PSY_FILES
Context action of thefilesoperator. -
PSY_FILESIZE
Context action of thefilesizeoperator. -
PSY_HARDLINK
Context action of thehardlinkoperator. -
PSY_ISDIRECTORY
Context action of theisdirectoryoperator. -
PSY_ISFILE
Context action of theisfileoperator. -
PSY_ISSAMEFILE
Context action of theissamefileoperator. -
PSY_ISSYMLINK
Context action of theissymlinkoperator. -
PSY_READLINK
Context action of thereadlinkoperator. -
PSY_RENAMEFILE
Context action of therenamefileoperator. -
PSY_SYMLINK
Context action of thesymlinkoperator.
-
-
Method Details
-
getPath
-
psyCreateDirectory
public static void psyCreateDirectory(PsyTextual oFileName) throws PsyFileExistsException, PsyFileAccessDeniedException, PsySecurityErrorException, PsyIOErrorException Creates a new directory with the given name.- Parameters:
oFileName- atextualrepresenting the name of the directory being created.- Throws:
PsyFileExistsException- when the directory already exists.PsyFileAccessDeniedException- when the operation is prohibited due to a file permission or other access check.PsySecurityErrorException- when security policy is violated.PsyIOErrorException- when an input/output error occurs.
-
psyDeleteFile
public static void psyDeleteFile(PsyTextual oFileName) throws PsyFileNotFoundException, PsyFileAccessDeniedException, PsyDirectoryNotEmptyException, PsySecurityErrorException, PsyIOErrorException Deletes a file or empty directory with a given name.- Parameters:
oFileName- atextualrepresenting the name of a file or directory.- Throws:
PsyDirectoryNotEmptyException- when the directory is not empty.PsyFileNotFoundException- when the file or directory does not exist.PsyFileAccessDeniedException- when the operation is prohibited due to a file permission or other access check.PsySecurityErrorException- when security policy is violated.PsyIOErrorException- when an input/output error occurs.
-
psyCopyFile
public static void psyCopyFile(PsyTextual oSourceName, PsyTextual oTargetName) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException Copies a file to the target file.- Parameters:
oSourceName- atextualrepresenting the name of the file to copy.oTargetName- atextualrepresenting the name of the target file.- Throws:
PsyDirectoryNotEmptyException- TODOPsyFileExistsException- TODOPsyFileNotFoundException- when the file or directory does not exist.PsyFileAccessDeniedException- when the operation is prohibited due to a file permission or other access check.PsySecurityErrorException- when security policy is violated.PsyIOErrorException- when an input/output error occurs.PsyUnsupportedException
-
psyReadLink
public static PsyName psyReadLink(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotLinkException, PsySecurityErrorException -
psySymlink
public static void psySymlink(PsyTextual oFileName1, PsyTextual oFileName2) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException -
psyHardlink
public static void psyHardlink(PsyTextual oFileName1, PsyTextual oFileName2) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException -
psyRenameFile
public static void psyRenameFile(PsyTextual oFileName1, PsyTextual oFileName2) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyFileExists
- Throws:
PsySecurityErrorException
-
psyIsFile
public static PsyBoolean psyIsFile(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyIsDirectory
public static PsyBoolean psyIsDirectory(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyIsSameFile
public static PsyBoolean psyIsSameFile(PsyTextual oFileName1, PsyTextual oFileName2) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyIsSymlink
public static PsyBoolean psyIsSymlink(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyFileSize
public static PsyInteger psyFileSize(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException Returns theintegerrepresenting the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName- atextualrepresenting the file name.- Returns:
- a
integerrepresenting the size (in bytes) of the file or directory. - Throws:
PsyFileAccessDeniedException- when the operation is prohibited due to a file permission or other access check.PsyFileNotFoundException- when the file or directory does not exist.PsySecurityErrorException- when security policy is violated.PsyIOErrorException- when an input/output error occurs.
-
psyFileAccessTime
public static PsyInteger psyFileAccessTime(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyFileCreationTime
public static PsyInteger psyFileCreationTime(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyFileModifiedTime
public static PsyInteger psyFileModifiedTime(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyCurrentDirectory
Returns anamerepresenting the absolute name of the current directory.- Returns:
- a
namerepresenting the absolute name of the current directory.
-
psyFileAbsolutePath
Returns anamerepresenting the absolute path to given file.- Parameters:
oFileName- anamerepresenting file name.- Returns:
- a
namerepresenting the absolute path. directory. - Throws:
PsyIOErrorException- when an input/output error occurs.
-
psyFilePermissions
public static PsyInteger psyFilePermissions(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyChangeFilePermissions
public static void psyChangeFilePermissions(PsyTextual oFileName, PsyInteger oPermissions) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException -
psyFileAttribute
public static PsyObject psyFileAttribute(PsyTextual oFileName, PsyTextual oAttribute) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException -
psyChangeFileAttribute
public static void psyChangeFileAttribute(PsyTextual oFileName, PsyTextual oAttribute, PsyObject oValue) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException -
psyFiles
public static PsyFormalStream<PsyName> psyFiles(PsyTextual oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotDirectoryException, PsySecurityErrorException
-