org.japtproxy.poolobject
Class PoolFile

java.lang.Object
  extended by org.japtproxy.poolobject.PoolFile
All Implemented Interfaces:
PoolObject

public class PoolFile
extends java.lang.Object
implements PoolObject

A file-based PoolObject implementation.

Version:
$LastChangedRevision:79 $
Author:
Oliver J. Siegmar

Constructor Summary
PoolFile(java.io.File resource)
          Initialize the PoolFile with the given resource.
 
Method Summary
 java.lang.String getContentType()
          Get the content type of the final resource.
 java.io.InputStream getInputStream()
          Get the InputStream of the final resource.
 long getLastModified()
          Get the timestamp of the final resource.
 java.lang.String getName()
          Get the name of the pool object.
 java.io.OutputStream getOutputStream()
          Get the OutputStream of the temp resource.
 long getSize()
          Get the size of the final resource.
 void remove()
          Removes temp and final resources.
 void setLastModified(long lastModified)
          Set a timestamp on the temp resource.
 void store()
          Saves the temp resource to the final one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolFile

public PoolFile(java.io.File resource)
         throws java.io.IOException
Initialize the PoolFile with the given resource.

Parameters:
resource - the file handle.
Throws:
java.io.IOException - is thrown if the initialization fails.
Method Detail

getLastModified

public long getLastModified()
Get the timestamp of the final resource.

Specified by:
getLastModified in interface PoolObject
Returns:
the timestamp of the final resource.

setLastModified

public void setLastModified(long lastModified)
Set a timestamp on the temp resource.

Specified by:
setLastModified in interface PoolObject
Parameters:
lastModified - a timestamp to set on the temp resource.

getSize

public long getSize()
Get the size of the final resource.

Specified by:
getSize in interface PoolObject
Returns:
the size of the final resource.

getContentType

public java.lang.String getContentType()
Get the content type of the final resource.

Specified by:
getContentType in interface PoolObject
Returns:
the content type of the final resource.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Get the InputStream of the final resource.

Specified by:
getInputStream in interface PoolObject
Returns:
the InputStream of the final resource.
Throws:
java.io.IOException - is thrown if this operation fails.

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Get the OutputStream of the temp resource.

Specified by:
getOutputStream in interface PoolObject
Returns:
the OutputStream of the temp resource.
Throws:
java.io.IOException - is thrown if this operation fails.

store

public void store()
Saves the temp resource to the final one.

Specified by:
store in interface PoolObject

remove

public void remove()
Removes temp and final resources.

Specified by:
remove in interface PoolObject

getName

public java.lang.String getName()
Get the name of the pool object.

Specified by:
getName in interface PoolObject
Returns:
the name of the pool object.


Copyright © 2006-2008. All Rights Reserved.