public class FileRepository extends AbstractRepository
Constructor and Description |
---|
FileRepository() |
FileRepository(java.io.File basedir) |
Modifier and Type | Method and Description |
---|---|
void |
delete(java.io.File f) |
void |
get(java.lang.String source,
java.io.File destination)
Fetch a resource from the repository.
|
java.io.File |
getBaseDir() |
java.lang.String |
getFileSeparator()
Get the repository's file separator string.
|
protected RepositoryCopyProgressListener |
getProgressListener() |
Resource |
getResource(java.lang.String source)
Return the resource associated with a specified identifier.
|
boolean |
isLocal() |
java.util.List |
list(java.lang.String parent)
Return a listing of resources names
|
void |
move(java.io.File src,
java.io.File dest) |
void |
put(java.io.File source,
java.lang.String destination,
boolean overwrite) |
void |
setBaseDir(java.io.File baseDir) |
void |
setLocal(boolean local) |
java.lang.String |
standardize(java.lang.String source)
Normalize a string.
|
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getName, hasTransferListener, put, removeTransferListener, setName, toString
public FileRepository()
public FileRepository(java.io.File basedir)
public Resource getResource(java.lang.String source) throws java.io.IOException
Repository
source
- A string identifying the resource.java.io.IOException
- On error while trying to get resource.public void get(java.lang.String source, java.io.File destination) throws java.io.IOException
Repository
source
- A string identifying the resource to be fetched.destination
- Where to place the fetched resource.java.io.IOException
- On retrieval failure.public void put(java.io.File source, java.lang.String destination, boolean overwrite) throws java.io.IOException
put
in class AbstractRepository
java.io.IOException
public void move(java.io.File src, java.io.File dest) throws java.io.IOException
java.io.IOException
public void delete(java.io.File f) throws java.io.IOException
java.io.IOException
protected RepositoryCopyProgressListener getProgressListener()
public java.util.List list(java.lang.String parent) throws java.io.IOException
Repository
parent
- The parent directory from which to generate the listing.java.io.IOException
- On listing failure.public boolean isLocal()
public void setLocal(boolean local)
public java.io.File getBaseDir()
public final void setBaseDir(java.io.File baseDir)
public java.lang.String standardize(java.lang.String source)
Repository
standardize
in interface Repository
standardize
in class AbstractRepository
source
- The string to normalize.public java.lang.String getFileSeparator()
Repository
getFileSeparator
in interface Repository
getFileSeparator
in class AbstractRepository