Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## fr.jayasoft.ivy.repository
Interface Resource

All Known Implementing Classes:
  FileResource, URLResource

public interface Resource

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 `Message.verbose(java.lang.String)` method.
- Failure of one of the interface's specified methods results in all other interface specified methods returning an empty value (`false`, `0`, `""`).

Method Summary
`boolean` | `exists()` Determine if the resource is available.
`long` | `getContentLength()` Get the resource size
`long` | `getLastModified()` Get the date the resource was last modified
`java.lang.String` | `getName()` Get the name of the resource.

Method Detail

### getName

    public java.lang.String getName()

  Get the name of the resource.

  Returns:
    the repositorie's assigned resource name/identifier.

### getLastModified

    public long getLastModified()

  Get the date the resource was last modified

  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()

  Get the resource size

  Returns:
    a `long` value representing the size of the resource in bytes.

### exists

    public boolean exists()

  Determine if the resource is available. Note that this method only checks for availability, not for actual existence.

  Returns:
    `boolean` value indicating if the resource is available.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD