Package io.antmedia.storage
Class StorageClient
java.lang.Object
io.antmedia.storage.StorageClient
- Direct Known Subclasses:
AmazonS3StorageClient,GCPStorageClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringAccess key to access the storagestatic final Stringprivate StringCache control policy for the file that is uploaded to the Storage.private booleanprivate StringEndpoint for the storage, it's optional and it's used in some platforms like Digital Ocean, Wasabi, OVH(package private) org.slf4j.Loggerprivate booleanprivate StringPermission of the file that is uploaded to the Storage.protected com.amazonaws.event.ProgressListenerprivate StringThe region of the storage.private StringSecret key for the storageprivate StringStorage type.private StringName of the storage.private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidDelete file from storageabstract voiddeleteMultipleFiles(String key, String regex) Delete Multiple files from storageabstract booleanCheck if the key exists in the bucketintbooleanbooleanabstract voidreset()Re-initialize the storage client with the current parametersvoidSave file to storage and delete the local fileabstract voidSave file to storage and delete the local file according to the parametervoidsave(String key, File file, boolean deleteLocalFile, com.amazonaws.event.ProgressListener progressListener) Save file to storage and delete the local file according to the parameterabstract voidsave(String key, InputStream inputStream, boolean waitForCompletion) Save input stream to the storage with key parametervoidsetAccessKey(String accessKey) voidsetCacheControl(String cacheControl) voidsetEnabled(boolean enabled) voidsetEndpoint(String endpoint) voidsetPathStyleAccessEnabled(boolean enabled) voidsetPermission(String permission) voidsetProgressListener(com.amazonaws.event.ProgressListener progressListener) voidvoidsetSecretKey(String secretKey) voidsetStorageClass(String storageClass) voidsetStorageName(String storageName) voidsetTransferBufferSize(int transferBufferSize)
-
Field Details
-
logger
org.slf4j.Logger logger -
BEAN_NAME
- See Also:
-
endpoint
Endpoint for the storage, it's optional and it's used in some platforms like Digital Ocean, Wasabi, OVH -
accessKey
Access key to access the storage -
secretKey
Secret key for the storage -
region
The region of the storage. It's like us-west-1 in S3 -
storageName
Name of the storage. It's bucketname for S3 -
permission
Permission of the file that is uploaded to the Storage. It may differ according to the implemenation. Default value is public-read -
cacheControl
Cache control policy for the file that is uploaded to the Storage. It may differ according to the implemenation. Default value is no-store, no-cache, must-revalidate, max-age=0 -
enabled
private boolean enabled -
storageClass
Storage type. In S3 there is standard, glacier, etc. -
progressListener
protected com.amazonaws.event.ProgressListener progressListener -
pathStyleAccessEnabled
private boolean pathStyleAccessEnabled -
transferBufferSize
private int transferBufferSize
-
-
Constructor Details
-
StorageClient
public StorageClient()
-
-
Method Details
-
delete
Delete file from storage- Parameters:
fileName-type-
-
deleteMultipleFiles
Delete Multiple files from storage- Parameters:
fileName-fileExtensions-
-
save
Save input stream to the storage with key parameter- Parameters:
key-inputStream-
-
save
Save file to storage and delete the local file according to the parameter- Parameters:
key-file-deleteLocalFile-
-
save
public void save(String key, File file, boolean deleteLocalFile, com.amazonaws.event.ProgressListener progressListener) Save file to storage and delete the local file according to the parameter- Parameters:
key-file-deleteLocalFile-progressListener-
-
setProgressListener
public void setProgressListener(com.amazonaws.event.ProgressListener progressListener) -
save
Save file to storage and delete the local file- Parameters:
key-file-
-
fileExist
Check if the key exists in the bucket- Parameters:
key-- Returns:
-
get
-
reset
public abstract void reset()Re-initialize the storage client with the current parameters -
getEndpoint
-
setEndpoint
-
getAccessKey
-
setAccessKey
-
getSecretKey
-
setSecretKey
-
getRegion
-
setRegion
-
getStorageName
-
setStorageName
-
setPermission
-
getPermission
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
setStorageClass
-
getStorageClass
-
getCacheControl
-
setCacheControl
-
setPathStyleAccessEnabled
public void setPathStyleAccessEnabled(boolean enabled) -
isPathStyleAccessEnabled
public boolean isPathStyleAccessEnabled() -
getTransferBufferSize
public int getTransferBufferSize() -
setTransferBufferSize
public void setTransferBufferSize(int transferBufferSize)
-