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 thefileabsolutepathoperator.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
Static MethodsModifier and TypeMethodDescriptionstatic voidpsyChangeFileAttribute(PsyString oFileName, PsyString oAttribute, PsyString oValue) static voidpsyChangeFilePermissions(PsyString oFileName, PsyInteger oPermissions) static voidpsyCopyFile(PsyString oSourceName, PsyString oTargetName) Copies a file to the target file.static voidpsyCreateDirectory(PsyString oFileName) Creates a new directory with the given name.static PsyStringReturns astringrepresenting the absolute name of the current directory.static voidpsyDeleteFile(PsyString oFileName) Deletes a file or empty directory with a given name.static PsyStringpsyFileAbsolutePath(PsyString oFileName) Returns astringrepresenting the absolute path to given file.static PsyIntegerpsyFileAccessTime(PsyString oFileName) static PsyObjectpsyFileAttribute(PsyString oFileName, PsyString oAttribute) static PsyIntegerpsyFileCreationTime(PsyString oFileName) static PsyBooleanpsyFileExists(PsyString oFileName) static PsyIntegerpsyFileModifiedTime(PsyString oFileName) static PsyIntegerpsyFilePermissions(PsyString oFileName) static PsyFormalStream<PsyString> Returns a lazily populated stream, the elements of which are the entries in the directory.static PsyIntegerpsyFileSize(PsyString oFileName) Returns theintegerrepresenting the size (in bytes) for the file or directory with the given name.static voidpsyHardlink(PsyString oExisting, PsyString oLink) Creates a new link (directory entry) for an existing file.static PsyBooleanpsyIsDirectory(PsyString oFileName) static PsyBooleanstatic PsyBooleanpsyIsSameFile(PsyString oFileName1, PsyString oFileName2) static PsyBooleanpsyIsSymlink(PsyString oFileName) static PsyStringpsyReadLink(PsyString oFileName) Returns the target of a symbolic link.static voidpsyRenameFile(PsyString oFileName1, PsyString oFileName2) static voidpsySymlink(PsyString oTarget, PsyString oLink) Creates a symbolic link to a target.
-
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_FILEABSOLUTEPATH
Context action of thefileabsolutepathoperator. -
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
-
psyCreateDirectory
static void psyCreateDirectory(PsyString oFileName) throws PsyFileExistsException, PsyFileAccessDeniedException, PsySecurityErrorException, PsyIOErrorException Creates a new directory with the given name.- Parameters:
oFileName- astringrepresenting 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 I/O error occurs.
-
psyDeleteFile
static void psyDeleteFile(PsyString oFileName) throws PsyFileNotFoundException, PsyFileAccessDeniedException, PsyDirectoryNotEmptyException, PsySecurityErrorException, PsyIOErrorException Deletes a file or empty directory with a given name.- Parameters:
oFileName- astringrepresenting 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 I/O error occurs.
-
psyCopyFile
static void psyCopyFile(PsyString oSourceName, PsyString oTargetName) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException Copies a file to the target file.- Parameters:
oSourceName- astringname of the file to copy.oTargetName- astringname 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 I/O error occurs.PsyUnsupportedException- TODO
-
psyReadLink
static PsyString psyReadLink(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotLinkException, PsySecurityErrorException Returns the target of a symbolic link.- Parameters:
oFileName- the name of the target file.- Returns:
- the target of a symbolic link
- Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsyNotLinkExceptionPsySecurityErrorException
-
psySymlink
static void psySymlink(PsyString oTarget, PsyString oLink) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException Creates a symbolic link to a target.- Parameters:
oTarget- the target of the symbolic link.oLink- the path of the symbolic link to create.- Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileExistsExceptionPsySecurityErrorExceptionPsyUnsupportedException
-
psyHardlink
static void psyHardlink(PsyString oExisting, PsyString oLink) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException Creates a new link (directory entry) for an existing file.- Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileExistsExceptionPsyFileNotFoundExceptionPsySecurityErrorExceptionPsyUnsupportedException
-
psyRenameFile
static void psyRenameFile(PsyString oFileName1, PsyString oFileName2) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyDirectoryNotEmptyExceptionPsyFileAccessDeniedExceptionPsyFileExistsExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyFileExists
- Throws:
PsySecurityErrorException
-
psyIsFile
static PsyBoolean psyIsFile(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyIsDirectory
static PsyBoolean psyIsDirectory(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyIsSameFile
static PsyBoolean psyIsSameFile(PsyString oFileName1, PsyString oFileName2) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyIsSymlink
static PsyBoolean psyIsSymlink(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyFileSize
static PsyInteger psyFileSize(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException Returns theintegerrepresenting the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName- astringrepresenting the file name.- Returns:
- the
integerrepresenting the size (in bytes) for the file or directory with the given name - 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 I/O error occurs.
-
psyFileAccessTime
static PsyInteger psyFileAccessTime(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyFileCreationTime
static PsyInteger psyFileCreationTime(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyFileModifiedTime
static PsyInteger psyFileModifiedTime(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyCurrentDirectory
Returns astringrepresenting the absolute name of the current directory.- Returns:
- a
stringrepresenting the absolute name of the current directory
-
psyFileAbsolutePath
Returns astringrepresenting the absolute path to given file.- Parameters:
oFileName- astringrepresenting file name.- Returns:
- a
stringrepresenting the absolute path to given file - Throws:
PsyIOErrorException- when an I/O error occurs.
-
psyFilePermissions
static PsyInteger psyFilePermissions(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyChangeFilePermissions
static void psyChangeFilePermissions(PsyString oFileName, PsyInteger oPermissions) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorException
-
psyFileAttribute
static PsyObject psyFileAttribute(PsyString oFileName, PsyString oAttribute) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorExceptionPsyTypeCheckExceptionPsyUndefinedExceptionPsyUnsupportedException
-
psyChangeFileAttribute
static void psyChangeFileAttribute(PsyString oFileName, PsyString oAttribute, PsyString oValue) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException - Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsySecurityErrorExceptionPsyTypeCheckExceptionPsyUndefinedExceptionPsyUnsupportedException
-
psyFiles
static PsyFormalStream<PsyString> psyFiles(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotDirectoryException, PsySecurityErrorException Returns a lazily populated stream, the elements of which are the entries in the directory. The listing is not recursive.}- Parameters:
oFileName- the name of the directory.- Returns:
- a lazily populated stream, the elements of which are the entries in the directory
- Throws:
PsyIOErrorException- when an I/O error occurs.PsyFileAccessDeniedExceptionPsyFileNotFoundExceptionPsyNotDirectoryExceptionPsySecurityErrorException
-