An utility class providing filesystem-related methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thechangefilepermissions
operator.static final ContextAction
Context action of thecopyfile
operator.static final ContextAction
Context action of thecreatedirectory
operator.static final ContextAction
Context action of thecurrentdirectory
operator.static final ContextAction
Context action of thedeletefile
operator.static final ContextAction
Context action of thefileabsolutepath
operator.static final ContextAction
Context action of thefileaccesstime
operator.static final ContextAction
Context action of thefileattribute
operator.static final ContextAction
Context action of thefilecreationtime
operator.static final ContextAction
Context action of thefileexists
operator.static final ContextAction
Context action of thefilemodifiedtime
operator.static final ContextAction
Context action of thefilepermissions
operator.static final ContextAction
Context action of thefiles
operator.static final ContextAction
Context action of thefilesize
operator.static final ContextAction
Context action of thehardlink
operator.static final ContextAction
Context action of theisdirectory
operator.static final ContextAction
Context action of theisfile
operator.static final ContextAction
Context action of theissamefile
operator.static final ContextAction
Context action of theissymlink
operator.static final ContextAction
Context action of thereadlink
operator.static final ContextAction
Context action of therenamefile
operator.static final ContextAction
Context action of thesymlink
operator. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic void
psyChangeFileAttribute
(PsyString oFileName, PsyString oAttribute, PsyString oValue) static void
psyChangeFilePermissions
(PsyString oFileName, PsyInteger oPermissions) static void
psyCopyFile
(PsyString oSourceName, PsyString oTargetName) Copies a file to the target file.static void
psyCreateDirectory
(PsyString oFileName) Creates a new directory with the given name.static PsyString
Returns astring
representing the absolute name of the current directory.static void
psyDeleteFile
(PsyString oFileName) Deletes a file or empty directory with a given name.static PsyString
psyFileAbsolutePath
(PsyString oFileName) Returns astring
representing the absolute path to given file.static PsyInteger
psyFileAccessTime
(PsyString oFileName) static PsyObject
psyFileAttribute
(PsyString oFileName, PsyString oAttribute) static PsyInteger
psyFileCreationTime
(PsyString oFileName) static PsyBoolean
psyFileExists
(PsyString oFileName) static PsyInteger
psyFileModifiedTime
(PsyString oFileName) static PsyInteger
psyFilePermissions
(PsyString oFileName) static PsyFormalStream
<PsyString> Returns a lazily populated stream, the elements of which are the entries in the directory.static PsyInteger
psyFileSize
(PsyString oFileName) Returns theinteger
representing the size (in bytes) for the file or directory with the given name.static void
psyHardlink
(PsyString oExisting, PsyString oLink) Creates a new link (directory entry) for an existing file.static PsyBoolean
psyIsDirectory
(PsyString oFileName) static PsyBoolean
static PsyBoolean
psyIsSameFile
(PsyString oFileName1, PsyString oFileName2) static PsyBoolean
psyIsSymlink
(PsyString oFileName) static PsyString
psyReadLink
(PsyString oFileName) Returns the target of a symbolic link.static void
psyRenameFile
(PsyString oFileName1, PsyString oFileName2) static void
psySymlink
(PsyString oTarget, PsyString oLink) Creates a symbolic link to a target.
-
Field Details
-
PSY_CHANGEFILEPERMISSIONS
Context action of thechangefilepermissions
operator. -
PSY_COPYFILE
Context action of thecopyfile
operator. -
PSY_CREATEDIRECTORY
Context action of thecreatedirectory
operator. -
PSY_CURRENTDIRECTORY
Context action of thecurrentdirectory
operator. -
PSY_DELETEFILE
Context action of thedeletefile
operator. -
PSY_FILEACCESSTIME
Context action of thefileaccesstime
operator. -
PSY_FILEABSOLUTEPATH
Context action of thefileabsolutepath
operator. -
PSY_FILEATTRIBUTE
Context action of thefileattribute
operator. -
PSY_FILECREATIONTIME
Context action of thefilecreationtime
operator. -
PSY_FILEEXISTS
Context action of thefileexists
operator. -
PSY_FILEMODIFIEDTIME
Context action of thefilemodifiedtime
operator. -
PSY_FILEPERMISSIONS
Context action of thefilepermissions
operator. -
PSY_FILES
Context action of thefiles
operator. -
PSY_FILESIZE
Context action of thefilesize
operator. -
PSY_HARDLINK
Context action of thehardlink
operator. -
PSY_ISDIRECTORY
Context action of theisdirectory
operator. -
PSY_ISFILE
Context action of theisfile
operator. -
PSY_ISSAMEFILE
Context action of theissamefile
operator. -
PSY_ISSYMLINK
Context action of theissymlink
operator. -
PSY_READLINK
Context action of thereadlink
operator. -
PSY_RENAMEFILE
Context action of therenamefile
operator. -
PSY_SYMLINK
Context action of thesymlink
operator.
-
-
Method Details
-
psyCreateDirectory
static void psyCreateDirectory(PsyString oFileName) throws PsyFileExistsException, PsyFileAccessDeniedException, PsySecurityErrorException, PsyIOErrorException Creates a new directory with the given name.- Parameters:
oFileName
- astring
representing 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
- astring
representing 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
- astring
name of the file to copy.oTargetName
- astring
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 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.PsyFileAccessDeniedException
PsyFileNotFoundException
PsyNotLinkException
PsySecurityErrorException
-
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.PsyFileAccessDeniedException
PsyFileExistsException
PsySecurityErrorException
PsyUnsupportedException
-
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.PsyFileAccessDeniedException
PsyFileExistsException
PsyFileNotFoundException
PsySecurityErrorException
PsyUnsupportedException
-
psyRenameFile
static void psyRenameFile(PsyString oFileName1, PsyString oFileName2) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyDirectoryNotEmptyException
PsyFileAccessDeniedException
PsyFileExistsException
PsyFileNotFoundException
PsySecurityErrorException
-
psyFileExists
- Throws:
PsySecurityErrorException
-
psyIsFile
static PsyBoolean psyIsFile(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyIsDirectory
static PsyBoolean psyIsDirectory(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyIsSameFile
static PsyBoolean psyIsSameFile(PsyString oFileName1, PsyString oFileName2) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyIsSymlink
static PsyBoolean psyIsSymlink(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyFileSize
static PsyInteger psyFileSize(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException Returns theinteger
representing the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName
- astring
representing the file name.- Returns:
- the
integer
representing 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.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyFileCreationTime
static PsyInteger psyFileCreationTime(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyFileModifiedTime
static PsyInteger psyFileModifiedTime(PsyString oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyCurrentDirectory
Returns astring
representing the absolute name of the current directory.- Returns:
- a
string
representing the absolute name of the current directory
-
psyFileAbsolutePath
Returns astring
representing the absolute path to given file.- Parameters:
oFileName
- astring
representing file name.- Returns:
- a
string
representing 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.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyChangeFilePermissions
static void psyChangeFilePermissions(PsyString oFileName, PsyInteger oPermissions) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
-
psyFileAttribute
static PsyObject psyFileAttribute(PsyString oFileName, PsyString oAttribute) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException - Throws:
PsyIOErrorException
- when an I/O error occurs.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
PsyTypeCheckException
PsyUndefinedException
PsyUnsupportedException
-
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.PsyFileAccessDeniedException
PsyFileNotFoundException
PsySecurityErrorException
PsyTypeCheckException
PsyUndefinedException
PsyUnsupportedException
-
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.PsyFileAccessDeniedException
PsyFileNotFoundException
PsyNotDirectoryException
PsySecurityErrorException
-