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
andBlobDownloadStrategy
implementation which use the local filesystem for storing the payload
-
-
Constructor Summary
Constructors Constructor Description FileSystemBlobStrategy(BlobTransferPolicy policy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createRootFolder()
Create the root folder if not existvoid
deleteFile(ActiveMQBlobMessage message)
protected File
getFile(ActiveMQBlobMessage message)
Return theFile
for theActiveMQBlobMessage
.InputStream
getInputStream(ActiveMQBlobMessage message)
Returns aFileInputStream
for the giveActiveMQBlobMessage
URL
uploadFile(ActiveMQBlobMessage message, File file)
URL
uploadStream(ActiveMQBlobMessage message, InputStream in)
-
-
-
Constructor Detail
-
FileSystemBlobStrategy
public FileSystemBlobStrategy(BlobTransferPolicy policy) throws MalformedURLException, URISyntaxException
-
-
Method Detail
-
createRootFolder
protected void createRootFolder() throws MalformedURLException, URISyntaxException
Create the root folder if not exist
-
uploadFile
public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException
- Specified by:
uploadFile
in interfaceBlobUploadStrategy
- Throws:
JMSException
IOException
-
uploadStream
public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException
- Specified by:
uploadStream
in interfaceBlobUploadStrategy
- Throws:
JMSException
IOException
-
deleteFile
public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException
- Specified by:
deleteFile
in interfaceBlobDownloadStrategy
- Throws:
IOException
JMSException
-
getInputStream
public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException
Returns aFileInputStream
for the giveActiveMQBlobMessage
- Specified by:
getInputStream
in interfaceBlobDownloadStrategy
- Throws:
IOException
JMSException
-
getFile
protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException
Return theFile
for theActiveMQBlobMessage
.- Parameters:
message
-- Returns:
- file
- Throws:
JMSException
IOException
-
-