Package io.antmedia.storage
Class StorageClient
java.lang.Object
io.antmedia.storage.StorageClient
- Direct Known Subclasses:
AmazonS3StorageClient
,GCPStorageClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Access key to access the storagestatic final String
private String
Cache control policy for the file that is uploaded to the Storage.private boolean
private String
Endpoint for the storage, it's optional and it's used in some platforms like Digital Ocean, Wasabi, OVHprivate boolean
private String
Permission of the file that is uploaded to the Storage.protected com.amazonaws.event.ProgressListener
private String
The region of the storage.private String
Secret key for the storageprivate String
Storage type.private String
Name of the storage.private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Delete file from storageabstract boolean
Check if the key exists in the bucketint
boolean
boolean
abstract void
reset()
Re-initialize the storage client with the current parametersvoid
Save file to storage and delete the local fileabstract void
Save file to storage and delete the local file according to the parameterabstract void
save
(String key, InputStream inputStream, boolean waitForCompletion) Save input stream to the storage with key parametervoid
setAccessKey
(String accessKey) void
setCacheControl
(String cacheControl) void
setEnabled
(boolean enabled) void
setEndpoint
(String endpoint) void
setPathStyleAccessEnabled
(boolean enabled) void
setPermission
(String permission) void
setProgressListener
(com.amazonaws.event.ProgressListener progressListener) void
void
setSecretKey
(String secretKey) void
setStorageClass
(String storageClass) void
setStorageName
(String storageName) void
setTransferBufferSize
(int transferBufferSize)
-
Field Details
-
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
-
-
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
-
-
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:
-
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)
-