public class StaticLocalResourceRepository extends Object implements Closeable, ResourceRepository
ResourceRepository
based on a local file system
root. It relies on an implementation of Source
to get files from
remote into the file system root.Constructor and Description |
---|
StaticLocalResourceRepository(File directory,
Source source)
Constructor with given working directory and file source and a given
working directory.
|
StaticLocalResourceRepository(Source source)
Constructor with a source that is responsible for getting files into the
working directory.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
static File |
createTempDirectory()
Create a temporary directory under system temdir
|
File |
getResource(String filePath)
Get file object for given relative file path in repository
|
Source |
getSource() |
File |
getWorkingDirectory() |
void |
init()
This method should be called before instance can be used.
|
public StaticLocalResourceRepository(Source source)
createTempDirectory()
method and wipe out the directory in
close()
call.source
- A source that gets filespublic StaticLocalResourceRepository(File directory, Source source)
close()
directory
- Given working directorysource
- Source of filesStaticLocalResourceRepository(Source)
public static File createTempDirectory()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public final File getWorkingDirectory()
public final Source getSource()
public void init() throws Exception
workingDirectory
. It does it by calling
Source.initWorkingDirectory(File)
Exception
- Allows any type of exceptionpublic File getResource(String filePath)
ResourceRepository
getResource
in interface ResourceRepository
filePath
- File path relative to the root of repositoryCopyright © 2009–2014. All rights reserved.