org.apache.ivy.plugins.repository

## Class AbstractRepository

- java.lang.Object
- - org.apache.ivy.plugins.repository.AbstractRepository

All Implemented Interfaces:
  Repository

Direct Known Subclasses:
  AbstractSshBasedRepository, ChainedRepository, FileRepository, JarRepository, URLRepository, VfsRepository, VsftpRepository

    public abstract class AbstractRepository
    extends java.lang.Object
    implements Repository

### Constructor Summary

Constructors
Constructor and Description
`AbstractRepository()`

### Method Summary

Methods
`void` `addTransferListener(TransferListener listener)` Add a listener to the repository.
`protected void` `fireTransferCompleted()`
`protected void` `fireTransferCompleted(long totalLength)`
`protected void` `fireTransferError()`
`protected void` `fireTransferError(java.lang.Exception ex)`
`protected void` `fireTransferEvent(TransferEvent evt)`
`protected void` `fireTransferInitiated(Resource res, int requestType)`
`protected void` `fireTransferProgress(long length)`
`protected void` `fireTransferStarted()`
`protected void` `fireTransferStarted(long totalLength)`
`java.lang.String` `getFileSeparator()` Get the repository's file separator string.
`java.lang.String` `getName()` Return the name of the repository
`boolean` `hasTransferListener(TransferListener listener)` Determine if a given listener is attached to the repository.
`void` `put(Artifact artifact, java.io.File source, java.lang.String destination, boolean overwrite)` Transfer a resource to the repository
`protected void` `put(java.io.File source, java.lang.String destination, boolean overwrite)`
`void` `removeTransferListener(TransferListener listener)` Remove a listener on the repository
`void` `setName(java.lang.String name)`
`java.lang.String` `standardize(java.lang.String source)` Normalize a string.
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ivy.plugins.repository.Repository

`get, getResource, list`

### Constructor Detail

#### AbstractRepository

    public AbstractRepository()

### Method Detail

#### addTransferListener

    public void addTransferListener(TransferListener listener)

Description copied from interface: `Repository`
Add a listener to the repository.

Specified by:
  `addTransferListener` in interface `Repository`
Parameters:
  `listener` - The listener to attach to the repository.

#### removeTransferListener

    public void removeTransferListener(TransferListener listener)

Description copied from interface: `Repository`
Remove a listener on the repository

Specified by:
  `removeTransferListener` in interface `Repository`
Parameters:
  `listener` - The listener to remove

#### hasTransferListener

    public boolean hasTransferListener(TransferListener listener)

Description copied from interface: `Repository`
Determine if a given listener is attached to the repository.

Specified by:
  `hasTransferListener` in interface `Repository`
Parameters:
  `listener` - The listener being queried
Returns:
  `true` if the provided listener is attached to the repository, `false` if not.

#### fireTransferInitiated

    protected void fireTransferInitiated(Resource res,
                             int requestType)

#### fireTransferStarted

    protected void fireTransferStarted()

#### fireTransferStarted

    protected void fireTransferStarted(long totalLength)

#### fireTransferProgress

    protected void fireTransferProgress(long length)

#### fireTransferCompleted

    protected void fireTransferCompleted()

#### fireTransferCompleted

    protected void fireTransferCompleted(long totalLength)

#### fireTransferError

    protected void fireTransferError()

#### fireTransferError

    protected void fireTransferError(java.lang.Exception ex)

#### fireTransferEvent

    protected void fireTransferEvent(TransferEvent evt)

#### getFileSeparator

    public java.lang.String getFileSeparator()

Description copied from interface: `Repository`
Get the repository's file separator string.

Specified by:
  `getFileSeparator` in interface `Repository`
Returns:
  The repository's file separator delimiter

#### standardize

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

Description copied from interface: `Repository`
Normalize a string.

Specified by:
  `standardize` in interface `Repository`
Parameters:
  `source` - The string to normalize.
Returns:
  The normalized string.

#### getName

    public java.lang.String getName()

Description copied from interface: `Repository`
Return the name of the repository

Specified by:
  `getName` in interface `Repository`

#### setName

    public void setName(java.lang.String name)

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### put

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

Description copied from interface: `Repository`
Transfer a resource to the repository

Specified by:
  `put` in interface `Repository`
Parameters:
  `artifact` - The artifact to be transferred.
  `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.

#### put

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

Throws:
  `java.io.IOException`