Package coneforest.psylla.core
Class PsyFileSystem
java.lang.Object
coneforest.psylla.core.PsyFileSystem
An utility class providing filesystem-related methods.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Path
getPath
(PsyTextual oFileName) static void
psyChangeFileAttribute
(PsyTextual oFileName, PsyTextual oAttribute, PsyObject oValue) static void
psyChangeFilePermissions
(PsyTextual oFileName, PsyInteger oPermissions) static void
psyCopyFile
(PsyTextual oSourceName, PsyTextual oTargetName) Copies a file to the target file.static void
psyCreateDirectory
(PsyTextual oFileName) Creates a new directory with the given name.static PsyName
Returns aname
representing the absolute name of the current directory.static void
psyDeleteFile
(PsyTextual oFileName) Deletes a file or empty directory with a given name.static PsyName
psyFileAbsolutePath
(PsyTextual oFileName) Returns aname
representing the absolute path to given file.static PsyInteger
psyFileAccessTime
(PsyTextual oFileName) static PsyObject
psyFileAttribute
(PsyTextual oFileName, PsyTextual oAttribute) static PsyInteger
psyFileCreationTime
(PsyTextual oFileName) static PsyBoolean
psyFileExists
(PsyTextual oFileName) static PsyInteger
psyFileModifiedTime
(PsyTextual oFileName) static PsyInteger
psyFilePermissions
(PsyTextual oFileName) static PsyFormalStream<PsyName>
psyFiles
(PsyTextual oFileName) static PsyInteger
psyFileSize
(PsyTextual oFileName) Returns theinteger
representing the size (in bytes) for the file or directory with the given name.static void
psyHardLink
(PsyTextual oFileName1, PsyTextual oFileName2) static PsyBoolean
psyIsDirectory
(PsyTextual oFileName) static PsyBoolean
psyIsFile
(PsyTextual oFileName) static PsyBoolean
psyIsSameFile
(PsyTextual oFileName1, PsyTextual oFileName2) static PsyBoolean
psyIsSymLink
(PsyTextual oFileName) static PsyName
psyReadLink
(PsyTextual oFileName) static void
psyRenameFile
(PsyTextual oFileName1, PsyTextual oFileName2) static void
psySymLink
(PsyTextual oFileName1, PsyTextual oFileName2)
-
Field Details
-
OPERATORS
-
-
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
- atextual
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 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
- atextual
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 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
- atextual
representing the name of the file to copy.oTargetName
- atextual
representing the name of the target file.- Throws:
PsyDirectoryNotEmptyException
PsyFileExistsException
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.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 theinteger
representing the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName
- atextual
representing the file name.- Returns:
- a
integer
representing 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 aname
representing the absolute name of the current directory.- Returns:
- a
name
representing the absolute name of the current directory.
-
psyFileAbsolutePath
Returns aname
representing the absolute path to given file.- Parameters:
oFileName
- aname
representing file name.- Returns:
- a
name
representing 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
-