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 Repository

All Known Implementing Classes:
  AbstractRepository

public interface Repository

Represents a collection of resources available to Ivy. Ivy uses one or more repositories as both a source of resources for Ivy enabled build systems and as a distribution center for resources generated by Ivy enabled build systems.

A repository supports the following fundamental operations

- retrieving a resource from the repository.
- transfering a resource to the repository.
- retrieving a listing of resources.

#### Resource Retrieval

`get(java.lang.String, java.io.File)` retrieves a resource specified by a provided identifier creating a new file .

#### resource Publication

`put(java.io.File, java.lang.String, boolean)` transfers a file to the repository.

#### resource Listing

`list(java.lang.String)` returns a listing of file like objects belonging to a specified parent directory.

Method Summary
`void` | `addTransferListener(TransferListener listener)` Add a listener to the repository.
`void` | `get(java.lang.String source, java.io.File destination)` Fetch a resource from the repository.
`java.lang.String` | `getFileSeparator()` Get the repository's file separator string.
`java.lang.String` | `getName()` Return the name of the repository
`Resource` | `getResource(java.lang.String source)` Return the resource associated with a specified identifier.
`boolean` | `hasTransferListener(TransferListener listener)` Determine if a given listener is attached to the repository.
`java.util.List` | `list(java.lang.String parent)` Return a listing of resources
`void` | `put(java.io.File source, java.lang.String destination, boolean overwrite)` Transfer a resource to the repository
`void` | `removeTransferListener(TransferListener listener)` Remove a listener on the repository
`java.lang.String` | `standardize(java.lang.String source)` Normalize a string.

Method Detail

### getResource

    public Resource getResource(java.lang.String source)
                         throws java.io.IOException

  Return the resource associated with a specified identifier.

  Parameters:
    `source` - A string identifying the resource.
  Returns:
    The resource associated with the resource identifier.
  Throws:
    `java.io.IOException` - On failure to get resource.

### get

    public void get(java.lang.String source,
                    java.io.File destination)
             throws java.io.IOException

  Fetch a resource from the repository.

  Parameters:
    `source` - A string identifying the resource to be fetched.
    `destination` - Where to place the fetched resource.
  Throws:
    `java.io.IOException` - On retrieval failure.

### put

    public void put(java.io.File source,
                    java.lang.String destination,
                    boolean overwrite)
             throws java.io.IOException

  Transfer a resource to the repository

  Parameters:
    `source` - The local file to be transferred.
    `destination` - Where to transfer the resource.
    `overwrite` - Whether the transfer should overwrite an existing resource.
  Throws:
    `java.io.IOException` - On publication failure.

### list

    public java.util.List list(java.lang.String parent)
                        throws java.io.IOException

  Return a listing of resources

  Parameters:
    `parent` - The parent directory from which to generate the listing.
  Returns:
    A listing of the parent directory's file content.
  Throws:
    `java.io.IOException` - On listing failure.

### addTransferListener

    public void addTransferListener(TransferListener listener)

  Add a listener to the repository.

  Parameters:
    `listener` - The listener to attach to the repository.

### removeTransferListener

    public void removeTransferListener(TransferListener listener)

  Remove a listener on the repository

  Parameters:
    `listener` - The listener to remove

### hasTransferListener

    public boolean hasTransferListener(TransferListener listener)

  Determine if a given listener is attached to the repository.

  Parameters:
    `listener` - The listener being quireied
  Returns:
    `true` if the provided listener is attached to the repository, `false` if not.

### getFileSeparator

    public java.lang.String getFileSeparator()

  Get the repository's file separator string.

  Returns:
    The repository's file separator delimiter

### standardize

    public java.lang.String standardize(java.lang.String source)

  Normalize a string.

  Parameters:
    `source` - The string to normalize.
  Returns:
    The normalized string.

### getName

    public java.lang.String getName()

  Return the name of the repository

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