Package org.codelibs.fess.storage
Interface StorageClient
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
GcsStorageClient,S3StorageClient
Interface for cloud storage operations.
Implementations provide access to S3-compatible storage, GCS, or other cloud storage systems.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the client and releases resources.voiddeleteObject(String objectName) Deletes an object from storage.voiddownloadObject(String objectName, OutputStream outputStream) Downloads an object from storage.voidEnsures the bucket exists, creating it if necessary.getObjectTags(String objectName) Gets tags/metadata for an object.booleanChecks if storage is properly configured and accessible.listObjects(String prefix, int maxItems) Lists objects in storage with the given prefix.voidsetObjectTags(String objectName, Map<String, String> tags) Sets tags/metadata for an object.voiduploadObject(String objectName, InputStream inputStream, long size, String contentType) Uploads an object to storage.
-
Method Details
-
uploadObject
Uploads an object to storage.- Parameters:
objectName- the name/path for the objectinputStream- the input stream of data to uploadsize- the size of the data in bytescontentType- the MIME type of the content
-
downloadObject
Downloads an object from storage.- Parameters:
objectName- the name/path of the object to downloadoutputStream- the output stream to write data to
-
deleteObject
Deletes an object from storage.- Parameters:
objectName- the name/path of the object to delete
-
listObjects
Lists objects in storage with the given prefix.- Parameters:
prefix- the path prefix to list objects under (null or empty for root)maxItems- maximum number of items to return- Returns:
- list of storage items
-
getObjectTags
Gets tags/metadata for an object.- Parameters:
objectName- the name/path of the object- Returns:
- map of tag key-value pairs
-
setObjectTags
Sets tags/metadata for an object.- Parameters:
objectName- the name/path of the objecttags- the tags to set
-
ensureBucketExists
void ensureBucketExists()Ensures the bucket exists, creating it if necessary. -
isAvailable
boolean isAvailable()Checks if storage is properly configured and accessible.- Returns:
- true if storage is available
-
close
void close()Closes the client and releases resources.- Specified by:
closein interfaceAutoCloseable
-