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 java.lang.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  java.io.File getFile(ActiveMQBlobMessage message)
          Return the File for the ActiveMQBlobMessage.
 java.io.InputStream getInputStream(ActiveMQBlobMessage message)
          Returns a FileInputStream for the give ActiveMQBlobMessage
 java.net.URL uploadFile(ActiveMQBlobMessage message, java.io.File file)
           
 java.net.URL uploadStream(ActiveMQBlobMessage message, java.io.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 java.net.MalformedURLException,
                              java.net.URISyntaxException
Throws:
java.net.MalformedURLException
java.net.URISyntaxException
Method Detail

createRootFolder

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

Throws:
java.net.MalformedURLException
java.net.URISyntaxException

uploadFile

public java.net.URL uploadFile(ActiveMQBlobMessage message,
                               java.io.File file)
                        throws javax.jms.JMSException,
                               java.io.IOException
Specified by:
uploadFile in interface BlobUploadStrategy
Throws:
javax.jms.JMSException
java.io.IOException

uploadStream

public java.net.URL uploadStream(ActiveMQBlobMessage message,
                                 java.io.InputStream in)
                          throws javax.jms.JMSException,
                                 java.io.IOException
Specified by:
uploadStream in interface BlobUploadStrategy
Throws:
javax.jms.JMSException
java.io.IOException

deleteFile

public void deleteFile(ActiveMQBlobMessage message)
                throws java.io.IOException,
                       javax.jms.JMSException
Specified by:
deleteFile in interface BlobDownloadStrategy
Throws:
java.io.IOException
javax.jms.JMSException

getInputStream

public java.io.InputStream getInputStream(ActiveMQBlobMessage message)
                                   throws java.io.IOException,
                                          javax.jms.JMSException
Returns a FileInputStream for the give ActiveMQBlobMessage

Specified by:
getInputStream in interface BlobDownloadStrategy
Throws:
java.io.IOException
javax.jms.JMSException

getFile

protected java.io.File getFile(ActiveMQBlobMessage message)
                        throws javax.jms.JMSException,
                               java.io.IOException
Return the File for the ActiveMQBlobMessage.

Parameters:
message -
Returns:
file
Throws:
javax.jms.JMSException
java.io.IOException


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.