Package coneforest.psylla
Class FileSystem
- java.lang.Object
-
- coneforest.psylla.FileSystem
-
public class FileSystem extends Object
An utility class providing filesystem-related methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path
getPath(PsyStringy oFileName)
static void
psyChangeFileAttribute(PsyStringy oFileName, PsyStringy oAttribute, PsyObject oValue)
static void
psyChangeFilePermissions(PsyStringy oFileName, PsyInteger oPermissions)
static void
psyCopyFile(PsyStringy oFileName1, PsyStringy oFileName2)
static void
psyCreateDirectory(PsyStringy oFileName)
Creates a new directory with the given name.static PsyName
psyCurrentDirectory()
Returns a Ψ-name
representing the absolute name of the current directory.static void
psyDeleteFile(PsyStringy oFileName)
Deletes a file or nonempty directory with a given name.static PsyName
psyFileAbsolutePath(PsyStringy oFileName)
Returns a Ψ-name
representing the absolute path to given file.static PsyInteger
psyFileAccessTime(PsyStringy oFileName)
static PsyObject
psyFileAttribute(PsyStringy oFileName, PsyStringy oAttribute)
static PsyInteger
psyFileCreationTime(PsyStringy oFileName)
static PsyBoolean
psyFileExists(PsyStringy oFileName)
static PsyInteger
psyFileModifiedTime(PsyStringy oFileName)
static PsyInteger
psyFilePermissions(PsyStringy oFileName)
static PsyIterable<PsyName>
psyFiles(PsyStringy oFileName)
static PsyInteger
psyFileSize(PsyStringy oFileName)
Returns the Ψ-integer
representing the size (in bytes) for the file or directory with the given name.static void
psyHardLink(PsyStringy oFileName1, PsyStringy oFileName2)
static PsyBoolean
psyIsDirectory(PsyStringy oFileName)
static PsyBoolean
psyIsFile(PsyStringy oFileName)
static PsyBoolean
psyIsSameFile(PsyStringy oFileName1, PsyStringy oFileName2)
static PsyBoolean
psyIsSymLink(PsyStringy oFileName)
static PsyName
psyReadLink(PsyStringy oFileName)
static void
psyRenameFile(PsyStringy oFileName1, PsyStringy oFileName2)
static void
psySymLink(PsyStringy oFileName1, PsyStringy oFileName2)
-
-
-
Method Detail
-
getPath
public static Path getPath(PsyStringy oFileName)
-
psyCreateDirectory
public static void psyCreateDirectory(PsyStringy oFileName) throws PsyFileExistsException, PsyFileAccessDeniedException, PsySecurityErrorException, PsyIOErrorException
Creates a new directory with the given name.- Parameters:
oFileName
- a Ψ-stringy
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(PsyStringy oFileName) throws PsyFileNotFoundException, PsyFileAccessDeniedException, PsyDirectoryNotEmptyException, PsySecurityErrorException, PsyIOErrorException
Deletes a file or nonempty directory with a given name.- Parameters:
oFileName
- a Ψ-stringy
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(PsyStringy oFileName1, PsyStringy oFileName2) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException
-
psyReadLink
public static PsyName psyReadLink(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotLinkException, PsySecurityErrorException
-
psySymLink
public static void psySymLink(PsyStringy oFileName1, PsyStringy oFileName2) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException
-
psyHardLink
public static void psyHardLink(PsyStringy oFileName1, PsyStringy oFileName2) throws PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyUnsupportedException
-
psyRenameFile
public static void psyRenameFile(PsyStringy oFileName1, PsyStringy oFileName2) throws PsyDirectoryNotEmptyException, PsyFileAccessDeniedException, PsyFileExistsException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyFileExists
public static PsyBoolean psyFileExists(PsyStringy oFileName) throws PsySecurityErrorException
- Throws:
PsySecurityErrorException
-
psyIsFile
public static PsyBoolean psyIsFile(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyIsDirectory
public static PsyBoolean psyIsDirectory(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyIsSameFile
public static PsyBoolean psyIsSameFile(PsyStringy oFileName1, PsyStringy oFileName2) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyIsSymLink
public static PsyBoolean psyIsSymLink(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyFileSize
public static PsyInteger psyFileSize(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
Returns the Ψ-integer
representing the size (in bytes) for the file or directory with the given name.- Parameters:
oFileName
- a Ψ-stringy
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(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyFileCreationTime
public static PsyInteger psyFileCreationTime(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyFileModifiedTime
public static PsyInteger psyFileModifiedTime(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyCurrentDirectory
public static PsyName psyCurrentDirectory()
Returns a Ψ-name
representing the absolute name of the current directory.- Returns:
- a Ψ-
name
representing the absolute name of the current directory.
-
psyFileAbsolutePath
public static PsyName psyFileAbsolutePath(PsyStringy oFileName) throws PsyIOErrorException
Returns a Ψ-name
representing the absolute path to given file.- Returns:
- a Ψ-
name
representing the absolute path. directory. - Throws:
PsyIOErrorException
-
psyFilePermissions
public static PsyInteger psyFilePermissions(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyChangeFilePermissions
public static void psyChangeFilePermissions(PsyStringy oFileName, PsyInteger oPermissions) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException
-
psyFileAttribute
public static PsyObject psyFileAttribute(PsyStringy oFileName, PsyStringy oAttribute) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException
-
psyChangeFileAttribute
public static void psyChangeFileAttribute(PsyStringy oFileName, PsyStringy oAttribute, PsyObject oValue) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsySecurityErrorException, PsyTypeCheckException, PsyUndefinedException, PsyUnsupportedException
-
psyFiles
public static PsyIterable<PsyName> psyFiles(PsyStringy oFileName) throws PsyFileAccessDeniedException, PsyFileNotFoundException, PsyIOErrorException, PsyNotDirectoryException, PsySecurityErrorException
-
-