Package de.dlr.proseo.storagemgr.posix
Class PosixDAL
java.lang.Object
de.dlr.proseo.storagemgr.posix.PosixDAL
A data access layer for interacting with a POSIX-based storage system. It
provides various methods to perform operations such as retrieving files,
checking file or directory existence, obtaining file content, uploading
files, downloading files, and deleting files or directories within the POSIX
storage system.
- Author:
- Denys Chaykovskiy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopies files or directories recursively from the posix file system to another posix file system (normally, to the cache)Copies a file from the POSIX file system to another posix file system (normally, to the cache) locationDeletes file or directory in storagedeleteFile(String sourceFile) Deletes file in storageDownloads files or directories recursively from the storage systemdownloadFile(String sourceFile, String targetFileOrDir) Downloads a file from the POSIX storage system to the specified target locationbooleanfileExists(String path) Checks if file physically existsGets the POSIX configuration used by this PosixDAL instance.getFileContent(String path) Retrieves the content of a file specified by its pathgetFileName(String path) Gets file nameRetrieves a list of files that match a given path (or prefix).booleanisDirectory(String path) Checks if path is existing directorybooleanChecks if path is existing fileUploads files or directories recursively to the storage systemuploadFile(String sourceFile, String targetFileOrDir) Uploads a source file to the POSIX storage system at the specified target location
-
Constructor Details
-
PosixDAL
Constructor- Parameters:
cfg- POSIX Configuration
-
-
Method Details
-
getConfiguration
Gets the POSIX configuration used by this PosixDAL instance.- Returns:
- the PosixConfiguration object
-
getFiles
Retrieves a list of files that match a given path (or prefix). It recursively scans directories and adds the absolute paths of files to the result- Parameters:
path- path (prefix)- Returns:
- list if files
-
getFileName
Gets file name- Parameters:
path- path- Returns:
- file name
-
fileExists
Checks if file physically exists- Parameters:
path- path- Returns:
- true if file exists
-
isDirectory
Checks if path is existing directory- Parameters:
path- path- Returns:
- true if path is directory
-
isFile
Checks if path is existing file- Parameters:
path- path- Returns:
- true if file exists
-
getFileContent
Retrieves the content of a file specified by its path- Parameters:
path- the path to the storage file- Returns:
- file content
- Throws:
IOException- if an I/O exception occurs
-
uploadFile
Uploads a source file to the POSIX storage system at the specified target location- Parameters:
sourceFile- source file to uploadtargetFileOrDir- target file or directory in storage- Returns:
- path of uploaded file
- Throws:
IOException- if file cannot be uploaded
-
upload
Uploads files or directories recursively to the storage system- Parameters:
sourceFileOrDir- source file or directory to uploadtargetFileOrDir- target file or directory in storage- Returns:
- path list of uploaded files
- Throws:
IOException- if files cannot be uploaded
-
downloadFile
Downloads a file from the POSIX storage system to the specified target location- Parameters:
sourceFile- source file in storage to downloadtargetFileOrDir- target file or directory- Returns:
- path of downloaded file
- Throws:
IOException- if file cannot be downloaded
-
download
Downloads files or directories recursively from the storage system- Parameters:
sourceFileOrDir- source file or directory in storage to downloadtargetFileOrDir- target file or directory- Returns:
- path list of downloaded files
- Throws:
IOException- true if file or directory cannot be downloaded
-
copyFile
Copies a file from the POSIX file system to another posix file system (normally, to the cache) location- Parameters:
sourceFile- posix source filetargetFileOrDir- posix target file or directory- Returns:
- path of downloaded file
- Throws:
IOException- if file cannot be downloaded
-
copy
Copies files or directories recursively from the posix file system to another posix file system (normally, to the cache)- Parameters:
sourceFileOrDir- posix source file or directorytargetFileOrDir- posix target file or directory- Returns:
- path list of copied files
- Throws:
IOException- true if file or directory cannot be copied
-
deleteFile
Deletes file in storage- Parameters:
sourceFile- file to delete in storage- Returns:
- path of deleted file
- Throws:
IOException- true if file cannot be deleted
-
delete
Deletes file or directory in storage- Parameters:
sourceFileOrDir- file or directory to delete- Returns:
- path list of deleted file or directory
- Throws:
IOException- true if file or directory cannot be deleted
-