org.codehaus.httpcache4j.payload
Class FilePayload

java.lang.Object
  extended by org.codehaus.httpcache4j.payload.FilePayload
All Implemented Interfaces:
Payload

public class FilePayload
extends java.lang.Object
implements Payload


Field Summary
protected  java.io.File file
           
 
Constructor Summary
FilePayload(java.io.File file, MIMEType mimeType)
           
 
Method Summary
 java.io.InputStream getInputStream()
          Returns the input stream of the payload.
 MIMEType getMimeType()
          Return the mime-type of the payload.
 boolean isAvailable()
          Returns true if the payload is available, IE.
 boolean isTransient()
          Returns the transientness of the payload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected java.io.File file
Constructor Detail

FilePayload

public FilePayload(java.io.File file,
                   MIMEType mimeType)
Method Detail

getMimeType

public MIMEType getMimeType()
Description copied from interface: Payload
Return the mime-type of the payload.

Specified by:
getMimeType in interface Payload
Returns:
the mime-type

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: Payload
Returns the input stream of the payload. This stream MUST be closed when you are done with it.

Specified by:
getInputStream in interface Payload
Returns:
the inputstream of the payload, may return null if the payload is not available.

isAvailable

public boolean isAvailable()
Description copied from interface: Payload
Returns true if the payload is available, IE. If the stream can be read from.

Specified by:
isAvailable in interface Payload
Returns:
true if the payload is available. false if not.

isTransient

public boolean isTransient()
Description copied from interface: Payload
Returns the transientness of the payload. I.E if the payload can be re-read.

Specified by:
isTransient in interface Payload
Returns:
true if the payload can be re-read. false if not.


Copyright © 2008. All Rights Reserved.