Package de.dlr.proseo.storagemgr.s3
Klasse S3Storage
java.lang.Object
de.dlr.proseo.storagemgr.s3.S3Storage
- Alle implementierten Schnittstellen:
- Storage
An implementation of the Storage interface for a S3-based file system,
 providing functionality to interact with the storage system, that is
 retrieving information about the storage, performing file operations, and
 path conversion.
- Autor:
- Denys Chaykovskiy
- 
KonstruktorübersichtKonstruktoren
- 
MethodenübersichtModifizierer und TypMethodeBeschreibungaddFSPrefix(String path) Adds the file system prefix to the path.addFSPrefix(List<String> paths) Adds the file system prefix to paths.booleanbucketExists(String bucketName) Checks if the bucket exists.createStorageFile(String relativePath, String content) Creates the physical storage file.delete(StorageFile storageFileOrDir) Deletes the file or directory recursively from the storage.Deletes the file or directory recursively from the storage.voiddeleteBucket(String bucketName) Deletes the bucket in storage.deleteFile(StorageFile storageFile) Deletes the storage file from storage.download(StorageFile sourceFileOrDir, StorageFile targetFileOrDir) Downloads the file or directory recursively.downloadFile(StorageFile sourceFile, StorageFile targetFileOrDir) Downloads the file from storage.booleanfileExists(StorageFile storageFile) Checks if the file exists.Gets the absolute base path (fs prefix + bucket + base path), depends on fs.Gets all files (absolute paths) from storage.getAbsoluteFiles(String relativePath) Gets files (absolute paths) from storage with the given relative path.getAbsolutePath(String relativePath) Gets the absolute path (s3://<bucket>/<relativePath>).getAbsolutePath(List<String> relativePaths) Gets the absolute paths (s3://<bucket>/<relativePath>).Gets the base path.Gets the bucket.Gets the buckets from storage.getFileContent(StorageFile storageFile) Gets the file content.longgetFileSize(StorageFile storageFile) Gets the file size.getInputStream(StorageFile storageFile) Gets the input stream from the file.Gets all files from storage.getRelativeFiles(String folder) Gets the files from storage with the given prefix (folder).getRelativePath(String absolutePath) Gets the relative path from the absolute path by removing the S3 prefix, bucket, and left slash.getRelativePath(List<String> absolutePaths) Gets the relative paths from the absolute paths by removing the S3 prefix, bucket, and left slash.Gets the source path.getStorageFile(String relativePath) Gets the Storage File.Gets the storage files.Gets the storage type.booleanisDirectory(StorageFile storageFileOrDir) Checks if the storage file or directory is a directory.booleanisFile(StorageFile storageFileOrDir) Checks if the storage file or directory is a file (no slash at the end of the path).voidSets the bucket.upload(StorageFile sourceFileOrDir) Uploads the file or directory recursively to the storage.upload(StorageFile sourceFileOrDir, StorageFile targetFileOrDir) Uploads the file or directory recursively to storage.uploadFile(StorageFile sourceFile) Uploads the file to the storage.uploadFile(StorageFile sourceFile, StorageFile targetFileOrDir) Uploads the file to storage.uploadSourceFile(String relativeSourceFile) Uploads the source file.uploadSourceFileOrDir(String relativeSourceFileOrDir) Uploads the source file or directory recursively to the storage.
- 
Konstruktordetails- 
S3StorageConstructor with the s3 configuration- Parameter:
- cfg- s3 configuration
- Löst aus:
- IOException- if an I/O exception occurs
 
 
- 
- 
Methodendetails- 
getStorageTypeGets the storage type.- Angegeben von:
- getStorageTypein Schnittstelle- Storage
- Gibt zurück:
- the storage type
 
- 
getBasePathGets the base path.- Angegeben von:
- getBasePathin Schnittstelle- Storage
- Gibt zurück:
- the base path
 
- 
getAbsoluteBasePathGets the absolute base path (fs prefix + bucket + base path), depends on fs. In other words, it is the absolute path without the relative path in this S3 version. s3://bucket/- Angegeben von:
- getAbsoluteBasePathin Schnittstelle- Storage
- Gibt zurück:
- the absolute base path
 
- 
getSourcePathGets the source path.- Angegeben von:
- getSourcePathin Schnittstelle- Storage
- Gibt zurück:
- the source path
 
- 
setBucketSets the bucket.- Angegeben von:
- setBucketin Schnittstelle- Storage
- Parameter:
- bucket- the bucket to set
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getBucketGets the bucket.
- 
getBucketsGets the buckets from storage.- Angegeben von:
- getBucketsin Schnittstelle- Storage
- Gibt zurück:
- the list of buckets
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
bucketExistsChecks if the bucket exists.- Angegeben von:
- bucketExistsin Schnittstelle- Storage
- Parameter:
- bucketName- the name of the bucket
- Gibt zurück:
- true if the bucket exists
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
deleteBucketDeletes the bucket in storage.- Angegeben von:
- deleteBucketin Schnittstelle- Storage
- Parameter:
- bucketName- the bucket to delete
- Löst aus:
- IOException- if the bucket cannot be deleted
 
- 
getRelativeFilesGets the files from storage with the given prefix (folder).- Angegeben von:
- getRelativeFilesin Schnittstelle- Storage
- Parameter:
- folder- the prefix (folder) for search in storage
- Gibt zurück:
- the list of files with the given prefix
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getRelativeFilesGets all files from storage.- Angegeben von:
- getRelativeFilesin Schnittstelle- Storage
- Gibt zurück:
- the list of all files from storage
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getAbsoluteFilesGets files (absolute paths) from storage with the given relative path.- Angegeben von:
- getAbsoluteFilesin Schnittstelle- Storage
- Parameter:
- relativePath- the relative path for search in storage
- Gibt zurück:
- the list of files with the given prefix
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getAbsoluteFilesGets all files (absolute paths) from storage.- Angegeben von:
- getAbsoluteFilesin Schnittstelle- Storage
- Gibt zurück:
- the list of all files from storage
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getRelativePathGets the relative path from the absolute path by removing the S3 prefix, bucket, and left slash.- Angegeben von:
- getRelativePathin Schnittstelle- Storage
- Parameter:
- absolutePath- the absolute path
- Gibt zurück:
- the relative path
 
- 
getRelativePathGets the relative paths from the absolute paths by removing the S3 prefix, bucket, and left slash.- Angegeben von:
- getRelativePathin Schnittstelle- Storage
- Parameter:
- absolutePaths- the absolute paths
- Gibt zurück:
- the relative paths
 
- 
getAbsolutePathGets the absolute path (s3://<bucket>/<relativePath>).- Angegeben von:
- getAbsolutePathin Schnittstelle- Storage
- Parameter:
- relativePath- the relative path
- Gibt zurück:
- the absolute file depending on the storage file system
 
- 
getAbsolutePathGets the absolute paths (s3://<bucket>/<relativePath>).- Angegeben von:
- getAbsolutePathin Schnittstelle- Storage
- Parameter:
- relativePaths- the relative paths
- Gibt zurück:
- the absolute paths depending on the storage file system
 
- 
getStorageFileGets the Storage File.- Angegeben von:
- getStorageFilein Schnittstelle- Storage
- Parameter:
- relativePath- the relative path in storage to the file
- Gibt zurück:
- the storage file object
 
- 
getStorageFilesGets the storage files.- Angegeben von:
- getStorageFilesin Schnittstelle- Storage
- Gibt zurück:
- the list of storage files
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
createStorageFileCreates the physical storage file.- Angegeben von:
- createStorageFilein Schnittstelle- Storage
- Parameter:
- relativePath- the relative path of the file
- content- the content of the file
- Gibt zurück:
- the storage file object of the created file
- Löst aus:
- IOException- if the file cannot be created
 
- 
fileExistsChecks if the file exists.- Angegeben von:
- fileExistsin Schnittstelle- Storage
- Parameter:
- storageFile- the storage file to check
- Gibt zurück:
- true if the file exists physically
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
isFileChecks if the storage file or directory is a file (no slash at the end of the path).- Angegeben von:
- isFilein Schnittstelle- Storage
- Parameter:
- storageFileOrDir- the storage file or directory
- Gibt zurück:
- true if the storage file is a file
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
isDirectoryChecks if the storage file or directory is a directory.- Angegeben von:
- isDirectoryin Schnittstelle- Storage
- Parameter:
- storageFileOrDir- the storage file or directory
- Gibt zurück:
- true if the storage file is a file
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getFileSizeGets the file size.- Angegeben von:
- getFileSizein Schnittstelle- Storage
- Parameter:
- storageFile- the storage file
- Gibt zurück:
- the file size of the storage file
- Löst aus:
- IOException- if an I/O exception occurs
 
- 
getFileContentGets the file content.- Angegeben von:
- getFileContentin Schnittstelle- Storage
- Parameter:
- storageFile- the storage file
- Gibt zurück:
- the file content
- Löst aus:
- IOException- if an error occurs while getting the file content
 
- 
uploadFileUploads the file to storage.- Angegeben von:
- uploadFilein Schnittstelle- Storage
- Parameter:
- sourceFile- the source file to upload
- targetFileOrDir- the target file or directory in the storage
- Gibt zurück:
- the uploaded storage file
- Löst aus:
- IOException- if the file cannot be uploaded
 
- 
uploadpublic List<String> upload(StorageFile sourceFileOrDir, StorageFile targetFileOrDir) throws IOException Uploads the file or directory recursively to storage.- Angegeben von:
- uploadin Schnittstelle- Storage
- Parameter:
- sourceFileOrDir- the source file or directory
- targetFileOrDir- the target file or directory in the storage
- Gibt zurück:
- the list of uploaded files
- Löst aus:
- IOException- if the file or directory cannot be uploaded
 
- 
uploadUploads the file or directory recursively to the storage.- Angegeben von:
- uploadin Schnittstelle- Storage
- Parameter:
- sourceFileOrDir- the source file or dir to upload
- Gibt zurück:
- the list of uploaded files
- Löst aus:
- IOException- if the file or directory cannot be uploaded
 
- 
uploadFileUploads the file to the storage.- Angegeben von:
- uploadFilein Schnittstelle- Storage
- Parameter:
- sourceFile- the source file to upload
- Gibt zurück:
- the path of the uploaded file
- Löst aus:
- IOException- if the file cannot be uploaded
 
- 
uploadSourceFileOrDirUploads the source file or directory recursively to the storage.- Angegeben von:
- uploadSourceFileOrDirin Schnittstelle- Storage
- Parameter:
- relativeSourceFileOrDir- the relative path to source file or directory
- Gibt zurück:
- the list of uploaded to storage source files
- Löst aus:
- IOException- if the file cannot be uploaded
 
- 
uploadSourceFileUploads the source file.- Angegeben von:
- uploadSourceFilein Schnittstelle- Storage
- Parameter:
- relativeSourceFile- the relative path to source file
- Gibt zurück:
- the uploaded to storage source file
- Löst aus:
- IOException- if the file cannot be uploaded
 
- 
downloadpublic List<String> download(StorageFile sourceFileOrDir, StorageFile targetFileOrDir) throws IOException Downloads the file or directory recursively.- Angegeben von:
- downloadin Schnittstelle- Storage
- Parameter:
- sourceFileOrDir- the source file or directory in the storage
- targetFileOrDir- the target file or directory
- Gibt zurück:
- the list of downloaded files
- Löst aus:
- IOException- if the file cannot be downloaded
 
- 
downloadFileDownloads the file from storage.- Angegeben von:
- downloadFilein Schnittstelle- Storage
- Parameter:
- sourceFile- the storage source file to download
- targetFileOrDir- the target file or directory
- Gibt zurück:
- the Storage File object with the downloaded file
- Löst aus:
- IOException- if the file cannot be downloaded
 
- 
deleteDeletes the file or directory recursively from the storage.- Angegeben von:
- deletein Schnittstelle- Storage
- Parameter:
- storageFileOrDir- the Storage file or directory to delete
- Gibt zurück:
- the list of deleted files from storage
- Löst aus:
- IOException- if the file or directory cannot be deleted
 
- 
deleteFileDeletes the storage file from storage.- Angegeben von:
- deleteFilein Schnittstelle- Storage
- Parameter:
- storageFile- the storage file to delete
- Gibt zurück:
- the deleted storage file
- Löst aus:
- IOException- if the file cannot be deleted
 
- 
deleteDeletes the file or directory recursively from the storage.- Angegeben von:
- deletein Schnittstelle- Storage
- Parameter:
- relativeFileOrDir- the Storage file or directory to delete
- Gibt zurück:
- the list of deleted files from storage
- Löst aus:
- IOException- if the file or directory cannot be deleted
 
- 
addFSPrefixAdds the file system prefix to the path.- Angegeben von:
- addFSPrefixin Schnittstelle- Storage
- Parameter:
- path- the path to extend
- Gibt zurück:
- the file system prefix + "|" + path
 
- 
addFSPrefixAdds the file system prefix to paths.- Angegeben von:
- addFSPrefixin Schnittstelle- Storage
- Parameter:
- paths- the paths to extend
- Gibt zurück:
- the list of file system prefix + path
 
- 
getInputStreamGets the input stream from the file.- Angegeben von:
- getInputStreamin Schnittstelle- Storage
- Parameter:
- storageFile- the storage file
- Gibt zurück:
- the input stream from the file
- Löst aus:
- IOException- if an error occurs while getting the input stream
 
 
-