org.apache.activemq.blob
Class FileSystemBlobStrategy

java.lang.Object
  extended by 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
FileSystemBlobStrategy(BlobTransferPolicy policy)
           
 
Method Summary
protected  void createRootFolder()
          Create the root folder if not exist
 void deleteFile(ActiveMQBlobMessage message)
           
protected  File getFile(ActiveMQBlobMessage message)
          Return the File for the ActiveMQBlobMessage.
 InputStream getInputStream(ActiveMQBlobMessage message)
          Returns a FileInputStream for the give ActiveMQBlobMessage
 URL uploadFile(ActiveMQBlobMessage message, File file)
           
 URL uploadStream(ActiveMQBlobMessage message, InputStream in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemBlobStrategy

public FileSystemBlobStrategy(BlobTransferPolicy policy)
                       throws MalformedURLException,
                              URISyntaxException
Throws:
MalformedURLException
URISyntaxException
Method Detail

createRootFolder

protected void createRootFolder()
                         throws MalformedURLException,
                                URISyntaxException
Create the root folder if not exist

Throws:
MalformedURLException
URISyntaxException

uploadFile

public URL uploadFile(ActiveMQBlobMessage message,
                      File file)
               throws JMSException,
                      IOException
Specified by:
uploadFile in interface BlobUploadStrategy
Throws:
JMSException
IOException

uploadStream

public URL uploadStream(ActiveMQBlobMessage message,
                        InputStream in)
                 throws JMSException,
                        IOException
Specified by:
uploadStream in interface BlobUploadStrategy
Throws:
JMSException
IOException

deleteFile

public void deleteFile(ActiveMQBlobMessage message)
                throws IOException,
                       JMSException
Specified by:
deleteFile in interface BlobDownloadStrategy
Throws:
IOException
JMSException

getInputStream

public InputStream getInputStream(ActiveMQBlobMessage message)
                           throws IOException,
                                  JMSException
Returns a FileInputStream for the give ActiveMQBlobMessage

Specified by:
getInputStream in interface BlobDownloadStrategy
Throws:
IOException
JMSException

getFile

protected File getFile(ActiveMQBlobMessage message)
                throws JMSException,
                       IOException
Return the File for the ActiveMQBlobMessage.

Parameters:
message -
Returns:
file
Throws:
JMSException
IOException


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.