| org.apache.ivy.plugins.repository.Resource
All known Subclasses: org.apache.ivy.plugins.repository.url.URLResource, org.apache.ivy.plugins.repository.sftp.SFTPResource, org.apache.ivy.plugins.repository.vfs.VfsResource, org.apache.ivy.plugins.repository.BasicResource, org.apache.ivy.plugins.repository.LazyResource, org.apache.ivy.plugins.repository.file.FileResource, org.apache.ivy.plugins.repository.ssh.SshResource,
Resource | public interface Resource (Code) | | Represents a resource in an Ivy
Repository . The resource interface allows one to obtain
the following information about a resource:
- resource name/identifier in repository syntax
- date the resource was last modified.
- size of the resource in bytes.
- if the resource is available.
Implementation Notes
In implementing the interface you need to ensure the following behaviors:
- All of the methods specified in the interface fail by returning an empty value
(
false , 0 , "" ).
In other words, the specified interface methods should not throw RuntimeExceptions.
- Failure conditions should be logged using the
org.apache.ivy.util.Message.verbose method.
- Failure of one of the interface's specified methods results in all other interface specified
methods returning an empty value (
false , 0 , "" ).
|
clone | public Resource clone(String cloneName)(Code) | | Clones this resource with a new resource with a different name
Parameters: cloneName - the name of the clone the cloned resource |
exists | public boolean exists()(Code) | | Determine if the resource is available.
Note that this method only checks for availability, not for actual existence.
boolean value indicating if the resource is available. |
getContentLength | public long getContentLength()(Code) | | Get the resource size
a long value representing the size of the resource in bytes. |
getLastModified | public long getLastModified()(Code) | | Get the date the resource was last modified
A long value representing the time the file was last modified,measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0L if the file does not exist or if an I/O error occurs. |
getName | public String getName()(Code) | | Get the name of the resource.
the repositorie's assigned resource name/identifier. |
isLocal | public boolean isLocal()(Code) | | Is this resource local to this host, i.e. is it on the file system?
boolean value indicating if the resource is local. |
|
|