Package org.cyclos.impl.storage
Class GoogleCloudStoredFileContentManagerImpl
- java.lang.Object
-
- org.cyclos.impl.storage.GoogleCloudStoredFileContentManagerImpl
-
- All Implemented Interfaces:
CustomBean,StoredFileContentManager
public class GoogleCloudStoredFileContentManagerImpl extends Object implements StoredFileContentManager
Manager implementation using Google Cloud Storage to store the file's content.
This implementation use as metadata the following String: bucketName/key
-
-
Field Summary
-
Fields inherited from interface org.cyclos.impl.storage.StoredFileContentManager
STORAGE_DIRECTORIES_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description GoogleCloudStoredFileContentManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SaveStoredFileContentActioncopy(String storageDirectory, Object sourceMetadata)Copies the content from the specified source, optionally in a specific directory, and returns the metadata of the copy.StringgetKey(StoredFile storedFile)The metadata is already a unique String and can be used as a key too.ObjectgetMetadata(StoredFile storedFile)Returns the content metadata associated to the specifiedStoredFileSerializableInputStreamopen(Object metadata)Opens a stream from the specified metadata to read the content from.StoredFileContentActionremove(Object metadata)Removes the specified content.booleanrequiresPersistentStoredFileToSetMetadata()Returns whether theStoredFileContentManager.setMetadata(StoredFile, Object)requires theStoredFileto be persisted or notvoidsetMetadata(StoredFile storedFile, Object metadata)Sets the content metadata to the specifiedStoredFile.SaveStoredFileContentActionstore(String storageDirectory, SerializableInputStream in)Stores a new content, optionally in a specific directory, and returns the content's metadata.booleansupportStorageDirectories()Returns true if the underlying implementation support store files in a specific directory other than the default-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.storage.StoredFileContentManager
isStoredOnDB
-
-
-
-
Method Detail
-
copy
public SaveStoredFileContentAction copy(String storageDirectory, Object sourceMetadata)
Description copied from interface:StoredFileContentManagerCopies the content from the specified source, optionally in a specific directory, and returns the metadata of the copy.- Specified by:
copyin interfaceStoredFileContentManager
-
getKey
public String getKey(StoredFile storedFile) throws StoredFileException
The metadata is already a unique String and can be used as a key too.- Specified by:
getKeyin interfaceStoredFileContentManager- Throws:
StoredFileException- See Also:
StoredFileContentManager.getKey(org.cyclos.entities.utils.StoredFile)
-
getMetadata
public Object getMetadata(StoredFile storedFile) throws StoredFileException
Description copied from interface:StoredFileContentManagerReturns the content metadata associated to the specifiedStoredFile- Specified by:
getMetadatain interfaceStoredFileContentManager- Throws:
StoredFileException
-
open
public SerializableInputStream open(Object metadata)
Description copied from interface:StoredFileContentManagerOpens a stream from the specified metadata to read the content from.- Specified by:
openin interfaceStoredFileContentManager
-
remove
public StoredFileContentAction remove(Object metadata)
Description copied from interface:StoredFileContentManagerRemoves the specified content.- Specified by:
removein interfaceStoredFileContentManager
-
requiresPersistentStoredFileToSetMetadata
public boolean requiresPersistentStoredFileToSetMetadata()
Description copied from interface:StoredFileContentManagerReturns whether theStoredFileContentManager.setMetadata(StoredFile, Object)requires theStoredFileto be persisted or not- Specified by:
requiresPersistentStoredFileToSetMetadatain interfaceStoredFileContentManager
-
setMetadata
public void setMetadata(StoredFile storedFile, Object metadata) throws StoredFileException
Description copied from interface:StoredFileContentManagerSets the content metadata to the specifiedStoredFile.- Specified by:
setMetadatain interfaceStoredFileContentManager- Throws:
StoredFileException
-
store
public SaveStoredFileContentAction store(String storageDirectory, SerializableInputStream in)
Description copied from interface:StoredFileContentManagerStores a new content, optionally in a specific directory, and returns the content's metadata.- Specified by:
storein interfaceStoredFileContentManager
-
supportStorageDirectories
public boolean supportStorageDirectories()
Description copied from interface:StoredFileContentManagerReturns true if the underlying implementation support store files in a specific directory other than the default- Specified by:
supportStorageDirectoriesin interfaceStoredFileContentManager
-
-