net.krecan.m2_proxy
Interface Resource

All Known Subinterfaces:
ResourceWithInputStream
All Known Implementing Classes:
AbstractResource, DefaultResource, HttpClientResource

public interface Resource

Resource abstraction.

Author:
Lukas Krecan

Method Summary
 void copyToStream(OutputStream outputStream)
          Copies the resource to the output stream.
 long getLastModified()
          Returns last modification date.
 long getLength()
          Returns length of the resource
 String getLogicalName()
          Returns path to the resource.
 void release()
          Releases all system resources blocked by this resource :-) It HAS to be called after using the resource.
 

Method Detail

getLength

long getLength()
Returns length of the resource

Returns:

copyToStream

void copyToStream(OutputStream outputStream)
                  throws IOException
Copies the resource to the output stream. You can call this method only once. It means, you can not recycle a resource. After copying, you have to release the resource.

Parameters:
outputStream -
Throws:
IOException

release

void release()
Releases all system resources blocked by this resource :-) It HAS to be called after using the resource.


getLastModified

long getLastModified()
Returns last modification date.

Returns:

getLogicalName

String getLogicalName()
Returns path to the resource. LogicalName == resourcePath

Returns:


Copyright © 2006 null. All Rights Reserved.