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
BlobUploadStrategyandBlobDownloadStrategyimplementation 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 voidcreateRootFolder()Create the root folder if not existvoiddeleteFile(ActiveMQBlobMessage message)protected FilegetFile(ActiveMQBlobMessage message)Return theFilefor theActiveMQBlobMessage.InputStreamgetInputStream(ActiveMQBlobMessage message)Returns aFileInputStreamfor the giveActiveMQBlobMessageURLuploadFile(ActiveMQBlobMessage message, File file)URLuploadStream(ActiveMQBlobMessage message, InputStream in)
-
-
-
Constructor Detail
-
FileSystemBlobStrategy
public FileSystemBlobStrategy(BlobTransferPolicy policy) throws MalformedURLException, URISyntaxException
-
-
Method Detail
-
createRootFolder
protected void createRootFolder() throws MalformedURLException, URISyntaxExceptionCreate the root folder if not exist
-
uploadFile
public URL uploadFile(ActiveMQBlobMessage message, File file) throws JMSException, IOException
- Specified by:
uploadFilein interfaceBlobUploadStrategy- Throws:
JMSExceptionIOException
-
uploadStream
public URL uploadStream(ActiveMQBlobMessage message, InputStream in) throws JMSException, IOException
- Specified by:
uploadStreamin interfaceBlobUploadStrategy- Throws:
JMSExceptionIOException
-
deleteFile
public void deleteFile(ActiveMQBlobMessage message) throws IOException, JMSException
- Specified by:
deleteFilein interfaceBlobDownloadStrategy- Throws:
IOExceptionJMSException
-
getInputStream
public InputStream getInputStream(ActiveMQBlobMessage message) throws IOException, JMSException
Returns aFileInputStreamfor the giveActiveMQBlobMessage- Specified by:
getInputStreamin interfaceBlobDownloadStrategy- Throws:
IOExceptionJMSException
-
getFile
protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException
Return theFilefor theActiveMQBlobMessage.- Parameters:
message-- Returns:
- file
- Throws:
JMSExceptionIOException
-
-