public interface StoredFileHandler
StoredFile entities and its content.| Modifier and Type | Method and Description |
|---|---|
void |
copy(StoredFile source,
StoredFile target)
Copies the source's attributes and content to target.
|
com.querydsl.core.types.dsl.BooleanExpression |
customFieldEquals(com.querydsl.core.types.EntityPath<?> sf,
CustomField<?,?,?> customField)
Returns a query predicate that any property of type CustomField points to the given custom field
|
<T extends StoredFile> |
find(java.lang.Class<T> clazz,
long id)
Finds a
StoredFile in the catalog, if found returns the StoredFile with the specified id. |
byte[] |
getBytes(StoredFile storedFile)
Returns the content of the specified
StoredFile as bytes |
SerializableInputStream |
getContent(StoredFile storedFile)
Opens an input stream to allow read the content of the specified
StoredFile. |
java.util.Set<java.lang.String> |
getStorageDirectories()
Returns the set of directory names available for store an individual document or a custom field of type
image/file configured in the cyclos.properties only if the underlying
StoredFileContentManager
implementation support store files in a specific directory other than the default. |
static java.util.Set<java.lang.String> |
getStorageDirectories(org.cyclos.server.utils.CyclosProperties cyclosProperties)
Retrieves the storage directories list from the cyclos.proeprties file.
|
java.lang.String |
getStorageDirectory(StoredFile storedFile)
Returns the storage directory, if any, for those cases where a custom storage directory can be specified
(individual documents, image/file custom fields).
|
boolean |
isStoredOnDB()
Returns whether the underlying storage for files is database
|
void |
move(StoredFile source,
StoredFile target)
Moves the source's attributes and content to target REMOVING the source.
|
void |
remove(long id)
Remove the stored file and its content.
|
void |
save(StoredFile storedFile,
SerializableInputStream in)
Saves (create/update) a stored file reading its content from the specified stream.
|
boolean |
supportStorageDirectories()
Returns true if the underlying
StoredFileContentManager implementation support store files in a specific
directory other than the default |
static java.util.Set<java.lang.String> getStorageDirectories(org.cyclos.server.utils.CyclosProperties cyclosProperties)
void copy(StoredFile source, StoredFile target) throws StoredFileException
StoredFileExceptioncom.querydsl.core.types.dsl.BooleanExpression customFieldEquals(com.querydsl.core.types.EntityPath<?> sf,
CustomField<?,?,?> customField)
<T extends StoredFile> T find(java.lang.Class<T> clazz, long id) throws StoredFileException, EntityNotFoundException
StoredFile in the catalog, if found returns the StoredFile with the specified id.StoredFileContentManagerEntityNotFoundException - if a stored file was not found.StoredFileExceptionbyte[] getBytes(StoredFile storedFile) throws StoredFileException, EntityNotFoundException
StoredFile as bytesSerializableInputStream getContent(StoredFile storedFile) throws StoredFileException, EntityNotFoundException
StoredFile.java.util.Set<java.lang.String> getStorageDirectories()
StoredFileContentManager
implementation support store files in a specific directory other than the default.
Otherwise returns an empty Set.java.lang.String getStorageDirectory(StoredFile storedFile)
boolean isStoredOnDB()
void move(StoredFile source, StoredFile target) throws StoredFileException
StoredFileExceptionvoid remove(long id)
throws StoredFileException,
EntityNotFoundException
void save(StoredFile storedFile, SerializableInputStream in) throws StoredFileException
SerializableInputStream after the method has completed.StoredFileExceptionboolean supportStorageDirectories()
StoredFileContentManager implementation support store files in a specific
directory other than the default