Package coneforest.psylla.core
Class PsyFileSystem
- java.lang.Object
-
- coneforest.psylla.core.PsyFileSystem
-
public class PsyFileSystem extends Object
An utility class providing filesystem-related methods.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 PsyNamepsyCurrentDirectory()Returns a Ψ-namerepresenting 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 a Ψ-namerepresenting 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 the Ψ-integerrepresenting 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 Detail
-
OPERATORS
public static final PsyOperator[] OPERATORS
-
-
Method Detail
-
getPath
public static Path getPath(PsyTextual oFileName)
-
psyCreateDirectory
public static void psyCreateDirectory(PsyTextual oFileName) throws PsyFileExistsException, PsyFileAccessDeniedException, PsySecurityErrorException, PsyIOErrorException
Creates a new directory with the given name.- Parameters:
oFileName- a Ψ-textualrepresenting 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- a Ψ-textualrepresenting 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- a Ψ-textualrepresenting the name of the file to copy.oTargetName- a Ψ-textualrepresenting the name of the target file.- Throws:
PsyDirectoryNotEmptyExceptionPsyFileExistsExceptionPsyFileNotFoundException- 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
public static PsyBoolean psyFileExists(PsyTextual oFileName) throws PsySecurityErrorException
- 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 the Ψ-integerrepresenting the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName- a Ψ-textualrepresenting 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
public static PsyName psyCurrentDirectory()
Returns a Ψ-namerepresenting the absolute name of the current directory.- Returns:
- a Ψ-
namerepresenting the absolute name of the current directory.
-
psyFileAbsolutePath
public static PsyName psyFileAbsolutePath(PsyTextual oFileName) throws PsyIOErrorException
Returns a Ψ-namerepresenting the absolute path to given file.- Parameters:
oFileName- a Ψ-namerepresenting 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
-
-