fr.jayasoft.ivy.repository.file
Class FileResource

java.lang.Object
  extended byfr.jayasoft.ivy.repository.file.FileResource
All Implemented Interfaces:
Resource

public class FileResource
extends java.lang.Object
implements Resource


Constructor Summary
FileResource(java.io.File f)
           
 
Method Summary
 boolean exists()
          Determine if the resource is available.
 long getContentLength()
          Get the resource size
 java.io.File getFile()
           
 long getLastModified()
          Get the date the resource was last modified
 java.lang.String getName()
          Get the name of the resource.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileResource

public FileResource(java.io.File f)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Resource
Get the name of the resource.

Specified by:
getName in interface Resource
Returns:
the repositorie's assigned resource name/identifier.

getLastModified

public long getLastModified()
Description copied from interface: Resource
Get the date the resource was last modified

Specified by:
getLastModified in interface Resource
Returns:
A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs.

getContentLength

public long getContentLength()
Description copied from interface: Resource
Get the resource size

Specified by:
getContentLength in interface Resource
Returns:
a long value representing the size of the resource in bytes.

exists

public boolean exists()
Description copied from interface: Resource
Determine if the resource is available.

Note that this method only checks for availability, not for actual existence.

Specified by:
exists in interface Resource
Returns:
boolean value indicating if the resource is available.

toString

public java.lang.String toString()

getFile

public java.io.File getFile()