Interface PriintStorageServiceLocal
public interface PriintStorageServiceLocal
Local interface for managing storage operations in the Priint system.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteMediaAsset(String tenant, String path, String fileName) Deletes a media asset from the storage.byte[]downloadMediaAssetData(String tenant, String path, String fileName) Downloads a media asset as a byte array.downloadMediaAssetStream(String tenant, String path, String fileName) Downloads a media asset as an input stream.voidduplicateDocument(com.priint.storage.DocumentDescriptor sourceDocumentDescriptor, com.priint.storage.DocumentDescriptor destinationDocumentDescriptor) Duplicates a document from a source descriptor to a destination descriptor.Optional<com.priint.storage.DocumentObjectType>getDocumentObjectType(com.priint.storage.StorageContext storageContext, String documentId, boolean isDocumentTemplate) Retrieves the document object type based on the provided context and document ID.com.priint.storage.PriintStorageRetrieves the primary Priint storage instance.com.priint.objectstorage.FileListinglistMediaAssets(String tenant, String path) Lists the media assets in a specific path for a tenant.voiduploadMediaAsset(byte[] sourceData, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using a byte array.voiduploadMediaAsset(File sourceFile, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using a source file.voiduploadMediaAsset(InputStream sourceStream, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using an input stream.
-
Method Details
-
getPriintStorage
com.priint.storage.PriintStorage getPriintStorage()Retrieves the primary Priint storage instance.- Returns:
- the
PriintStorageinstance.
-
getDocumentObjectType
Optional<com.priint.storage.DocumentObjectType> getDocumentObjectType(com.priint.storage.StorageContext storageContext, String documentId, boolean isDocumentTemplate) Retrieves the document object type based on the provided context and document ID.- Parameters:
storageContext- the context of the storage operation.documentId- the ID of the document.isDocumentTemplate-trueif the document is a template,falseotherwise.- Returns:
- an
Optionalcontaining theDocumentObjectTypeif found, or empty otherwise.
-
duplicateDocument
void duplicateDocument(com.priint.storage.DocumentDescriptor sourceDocumentDescriptor, com.priint.storage.DocumentDescriptor destinationDocumentDescriptor) Duplicates a document from a source descriptor to a destination descriptor.- Parameters:
sourceDocumentDescriptor- the descriptor of the source document.destinationDocumentDescriptor- the descriptor of the destination document.
-
uploadMediaAsset
void uploadMediaAsset(File sourceFile, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using a source file.- Parameters:
sourceFile- the source file to upload.tenant- the tenant owning the media asset.destinationPath- the destination path for the media asset.destinationFileName- the name of the file at the destination.
-
uploadMediaAsset
void uploadMediaAsset(InputStream sourceStream, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using an input stream.- Parameters:
sourceStream- the input stream of the source data.tenant- the tenant owning the media asset.destinationPath- the destination path for the media asset.destinationFileName- the name of the file at the destination.
-
uploadMediaAsset
void uploadMediaAsset(byte[] sourceData, String tenant, String destinationPath, String destinationFileName) Uploads a media asset to the storage using a byte array.- Parameters:
sourceData- the byte array containing the source data.tenant- the tenant owning the media asset.destinationPath- the destination path for the media asset.destinationFileName- the name of the file at the destination.
-
listMediaAssets
Lists the media assets in a specific path for a tenant.- Parameters:
tenant- the tenant owning the media assets.path- the path to list the media assets.- Returns:
- a
FileListingcontaining the list of media assets.
-
downloadMediaAssetStream
Downloads a media asset as an input stream.- Parameters:
tenant- the tenant owning the media asset.path- the path to the media asset.fileName- the name of the file to download.- Returns:
- an
InputStreamfor the media asset.
-
downloadMediaAssetData
Downloads a media asset as a byte array.- Parameters:
tenant- the tenant owning the media asset.path- the path to the media asset.fileName- the name of the file to download.- Returns:
- a byte array containing the media asset data.
-
deleteMediaAsset
Deletes a media asset from the storage.- Parameters:
tenant- the tenant owning the media asset.path- the path to the media asset.fileName- the name of the file to delete.
-