Package com.basis.api.admin
Interface BBjAdminFile
- All Superinterfaces:
BBjAdminPropertyReader
,BBjAdminPropertyWriter
,Remote
A BBjAdminFile represents a file or directory on the file system
of the machine running BBj Services. This does not support using Data Server
syntax for accessing files. This class is strictly for accessing and listing
files at the operating system level.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Delete the file described by this object.boolean
exists()
Returns true if the file exists, or false otherwise.getBBjFileInfo
(boolean p_includeDirectoryDetails, boolean p_recursiveDirectorySize) If the file is a BBj file (MKEYED, XKEYED, program file, etc.) this will contain the BBj-specific details about the file.byte[]
Returns the contents of the entire file as a byte[].Returns the parent directory of this file or directory.long
getTotalSize
(boolean p_includeSubdirectories) Returns the total bytes used by files under this file instance and optionally including all subdirectories.listFiles
(boolean p_sortDirectoriesFirst) Returns a list of the files in the directory if this is a directory or null if it is a file.boolean
mkdirs()
Creates the directory described by this object, as well as any parent directories.void
Change the name of the file.Methods inherited from interface com.basis.api.admin.BBjAdminPropertyReader
checkValueEqual, contains, contains, getBoolean, getDouble, getInt, getList, getLong, getProperties, getString, getType, getTypes, getValue
Methods inherited from interface com.basis.api.admin.BBjAdminPropertyWriter
addType, canAddNewProperties, canClear, clear, clearProperties, clearProperty, getReadOnly, hasChanged, isReadOnly, setBoolean, setDouble, setInt, setList, setLong, setProperties, setString, setValue
-
Field Details
-
FULL_PATH
- See Also:
-
NAME
- See Also:
-
DIRECTORY
- See Also:
-
MODIFIED
- See Also:
-
SIZE
- See Also:
-
-
Method Details
-
listFiles
Returns a list of the files in the directory if this is a directory or null if it is a file.- Parameters:
p_sortDirectoriesFirst
- True if the directories should be sorted at the beginning of the list. If false, the directories and files will be mixed together, sorted alphabetically (case insensitive).- Returns:
- List of files contained in this directory.
- Throws:
BBjAdminException
-
exists
Returns true if the file exists, or false otherwise.- Returns:
- True if the file exists or false if it does not exist.
- Throws:
BBjAdminException
-
getContents
Returns the contents of the entire file as a byte[].- Returns:
- The contents of the entire file as a byte array.
- Throws:
BBjAdminException
-
getParent
Returns the parent directory of this file or directory.- Returns:
- The parent directory for this file or directory.
- Throws:
BBjAdminException
-
delete
Delete the file described by this object.- Throws:
BBjAdminException
-
mkdirs
Creates the directory described by this object, as well as any parent directories.- Returns:
- True if the directory and all parent directories were successfully created, false otherwise.
- Throws:
BBjAdminException
-
getBBjFileInfo
BBjAdminBBjFileInfo getBBjFileInfo(boolean p_includeDirectoryDetails, boolean p_recursiveDirectorySize) throws BBjAdminException If the file is a BBj file (MKEYED, XKEYED, program file, etc.) this will contain the BBj-specific details about the file.- Returns:
- BBj-specific details about the file.
- Throws:
BBjAdminException
-
rename
Change the name of the file.- Parameters:
p_newName
- New name for the file.- Throws:
BBjAdminException
-
getTotalSize
Returns the total bytes used by files under this file instance and optionally including all subdirectories. If this is not a directory, it will simply return the size of this file.- Parameters:
p_includeSubdirectories
- Include subdirectories in the calculation.- Returns:
- Total bytes used by files under this file instance or the size of this file.
- Throws:
BBjAdminException
-