Klasse PosixDAL

java.lang.Object
de.dlr.proseo.storagemgr.posix.PosixDAL

public class PosixDAL extends Object
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.
Autor:
Denys Chaykovskiy
  • Konstruktordetails

    • PosixDAL

      public PosixDAL(PosixConfiguration cfg)
      Constructor
      Parameter:
      cfg - POSIX Configuration
  • Methodendetails

    • getConfiguration

      public PosixConfiguration getConfiguration()
      Gets the POSIX configuration used by this PosixDAL instance.
      Gibt zurück:
      the PosixConfiguration object
    • getFiles

      public List<String> getFiles(String path)
      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
      Parameter:
      path - path (prefix)
      Gibt zurück:
      list if files
    • getFileName

      public String getFileName(String path)
      Gets file name
      Parameter:
      path - path
      Gibt zurück:
      file name
    • fileExists

      public boolean fileExists(String path)
      Checks if file physically exists
      Parameter:
      path - path
      Gibt zurück:
      true if file exists
    • isDirectory

      public boolean isDirectory(String path)
      Checks if path is existing directory
      Parameter:
      path - path
      Gibt zurück:
      true if path is directory
    • isFile

      public boolean isFile(String path)
      Checks if path is existing file
      Parameter:
      path - path
      Gibt zurück:
      true if file exists
    • getFileContent

      public String getFileContent(String path) throws IOException
      Retrieves the content of a file specified by its path
      Parameter:
      path - the path to the storage file
      Gibt zurück:
      file content
      Löst aus:
      IOException - if an I/O exception occurs
    • uploadFile

      public String uploadFile(String sourceFile, String targetFileOrDir) throws IOException
      Uploads a source file to the POSIX storage system at the specified target location
      Parameter:
      sourceFile - source file to upload
      targetFileOrDir - target file or directory in storage
      Gibt zurück:
      path of uploaded file
      Löst aus:
      IOException - if file cannot be uploaded
    • upload

      public List<String> upload(String sourceFileOrDir, String targetFileOrDir) throws IOException
      Uploads files or directories recursively to the storage system
      Parameter:
      sourceFileOrDir - source file or directory to upload
      targetFileOrDir - target file or directory in storage
      Gibt zurück:
      path list of uploaded files
      Löst aus:
      IOException - if files cannot be uploaded
    • downloadFile

      public String downloadFile(String sourceFile, String targetFileOrDir) throws IOException
      Downloads a file from the POSIX storage system to the specified target location
      Parameter:
      sourceFile - source file in storage to download
      targetFileOrDir - target file or directory
      Gibt zurück:
      path of downloaded file
      Löst aus:
      IOException - if file cannot be downloaded
    • download

      public List<String> download(String sourceFileOrDir, String targetFileOrDir) throws IOException
      Downloads files or directories recursively from the storage system
      Parameter:
      sourceFileOrDir - source file or directory in storage to download
      targetFileOrDir - target file or directory
      Gibt zurück:
      path list of downloaded files
      Löst aus:
      IOException - true if file or directory cannot be downloaded
    • copyFile

      public String copyFile(String sourceFile, String targetFileOrDir) throws IOException
      Copies a file from the POSIX file system to another posix file system (normally, to the cache) location
      Parameter:
      sourceFile - posix source file
      targetFileOrDir - posix target file or directory
      Gibt zurück:
      path of downloaded file
      Löst aus:
      IOException - if file cannot be downloaded
    • copy

      public List<String> copy(String sourceFileOrDir, String targetFileOrDir) throws IOException
      Copies files or directories recursively from the posix file system to another posix file system (normally, to the cache)
      Parameter:
      sourceFileOrDir - posix source file or directory
      targetFileOrDir - posix target file or directory
      Gibt zurück:
      path list of copied files
      Löst aus:
      IOException - true if file or directory cannot be copied
    • deleteFile

      public String deleteFile(String sourceFile) throws IOException
      Deletes file in storage
      Parameter:
      sourceFile - file to delete in storage
      Gibt zurück:
      path of deleted file
      Löst aus:
      IOException - true if file cannot be deleted
    • delete

      public List<String> delete(String sourceFileOrDir) throws IOException
      Deletes file or directory in storage
      Parameter:
      sourceFileOrDir - file or directory to delete
      Gibt zurück:
      path list of deleted file or directory
      Löst aus:
      IOException - true if file or directory cannot be deleted