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 void
Create the root folder if not existvoid
deleteFile
(ActiveMQBlobMessage message) protected File
getFile
(ActiveMQBlobMessage message) Return theFile
for theActiveMQBlobMessage
.getInputStream
(ActiveMQBlobMessage message) Returns aFileInputStream
for the giveActiveMQBlobMessage
uploadFile
(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:
uploadFile
in interfaceBlobUploadStrategy
- Throws:
jakarta.jms.JMSException
IOException
-
uploadStream
public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws jakarta.jms.JMSException, IOException - Specified by:
uploadStream
in interfaceBlobUploadStrategy
- Throws:
jakarta.jms.JMSException
IOException
-
deleteFile
- Specified by:
deleteFile
in interfaceBlobDownloadStrategy
- Throws:
IOException
jakarta.jms.JMSException
-
getInputStream
public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, jakarta.jms.JMSException Returns aFileInputStream
for the giveActiveMQBlobMessage
- Specified by:
getInputStream
in interfaceBlobDownloadStrategy
- Throws:
IOException
jakarta.jms.JMSException
-
getFile
Return theFile
for theActiveMQBlobMessage
.- Parameters:
message
-- Returns:
- file
- Throws:
jakarta.jms.JMSException
IOException
-