Package org.apache.activemq.blob
Class FileSystemBlobStrategy
java.lang.Object
org.apache.activemq.blob.FileSystemBlobStrategy
- All Implemented Interfaces:
BlobDownloadStrategy,BlobUploadStrategy
public class FileSystemBlobStrategy
extends Object
implements BlobUploadStrategy, BlobDownloadStrategy
BlobUploadStrategy and BlobDownloadStrategy implementation which use the local filesystem for storing
the payload-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreate the root folder if not existvoiddeleteFile(ActiveMQBlobMessage message) protected FilegetFile(ActiveMQBlobMessage message) Return theFilefor theActiveMQBlobMessage.getInputStream(ActiveMQBlobMessage message) Returns aFileInputStreamfor the giveActiveMQBlobMessageuploadFile(ActiveMQBlobMessage message, File file) uploadStream(ActiveMQBlobMessage message, InputStream in)
-
Constructor Details
-
FileSystemBlobStrategy
public FileSystemBlobStrategy(BlobTransferPolicy policy) throws MalformedURLException, URISyntaxException
-
-
Method Details
-
createRootFolder
Create the root folder if not exist -
uploadFile
public URL uploadFile(ActiveMQBlobMessage message, File file) throws jakarta.jms.JMSException, IOException - Specified by:
uploadFilein interfaceBlobUploadStrategy- Throws:
jakarta.jms.JMSExceptionIOException
-
uploadStream
public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws jakarta.jms.JMSException, IOException - Specified by:
uploadStreamin interfaceBlobUploadStrategy- Throws:
jakarta.jms.JMSExceptionIOException
-
deleteFile
- Specified by:
deleteFilein interfaceBlobDownloadStrategy- Throws:
IOExceptionjakarta.jms.JMSException
-
getInputStream
public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, jakarta.jms.JMSException Returns aFileInputStreamfor the giveActiveMQBlobMessage- Specified by:
getInputStreamin interfaceBlobDownloadStrategy- Throws:
IOExceptionjakarta.jms.JMSException
-
getFile
Return theFilefor theActiveMQBlobMessage.- Parameters:
message-- Returns:
- file
- Throws:
jakarta.jms.JMSExceptionIOException
-