org.apache.axiom.attachments.lifecycle.impl
Class FileAccessor

java.lang.Object
  extended by java.util.Observable
      extended by org.apache.axiom.attachments.lifecycle.impl.FileAccessor

public class FileAccessor
extends Observable

FileAccessor wraps the attachment temp file. It is created from PartOnFile. The idea behind wrapping the file is to give rumtime an ability to track when the file is accessed with streams or data handler and accordingly trigger events to handle the the files lifecycle.


Constructor Summary
FileAccessor(LifecycleManager manager, File file)
           
 
Method Summary
 int getAccessCount()
           
 DataHandler getDataHandler(String contentType)
          Deprecated. This method is no longer used in Axiom 1.2.13 and will be removed in Axiom 1.3.
 File getFile()
           
 String getFileName()
           
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 long getSize()
           
 void setFile(File file)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAccessor

public FileAccessor(LifecycleManager manager,
                    File file)
Method Detail

getDataHandler

public DataHandler getDataHandler(String contentType)
                           throws MessagingException
Deprecated. This method is no longer used in Axiom 1.2.13 and will be removed in Axiom 1.3.

Throws:
MessagingException

getFileName

public String getFileName()
                   throws MessagingException
Throws:
MessagingException

getInputStream

public InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Throws:
IOException
MessagingException

getOutputStream

public OutputStream getOutputStream()
                             throws FileNotFoundException
Throws:
FileNotFoundException

getSize

public long getSize()

getFile

public File getFile()

setFile

public void setFile(File file)

getAccessCount

public int getAccessCount()


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.