Package org.eclipse.jetty.start
Class FileInitializer
- java.lang.Object
-
- org.eclipse.jetty.start.FileInitializer
-
- Direct Known Subclasses:
BaseHomeFileInitializer,LocalFileInitializer,MavenLocalRepoFileInitializer,TestFileInitializer,UriFileInitializer
public abstract class FileInitializer extends Object
Interface for initializing a file resource.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFileInitializer(BaseHome basehome, String... scheme)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheck(URI uri, String location)booleancopyDirectory(Path source, Path destination)abstract booleancreate(URI uri, String location)Initialize a file resourceprotected voiddownload(URI uri, Path destination)protected PathgetDestination(URI uri, String location)booleanisApplicable(URI uri)protected booleanisFilePresent(Path... paths)Test if any of the Paths exist (as files)
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(URI uri)
-
create
public abstract boolean create(URI uri, String location) throws IOException
Initialize a file resource- Parameters:
uri- the URI of the resource acting as its sourcelocation- the simple string reference to the output file, suitable for searching for the file in other locations (like ${jetty.home} or ${jetty.dir}) *- Returns:
- true if local file system is modified.
- Throws:
IOException- if there was an attempt to initialize, but an error occurred.
-
check
public boolean check(URI uri, String location) throws IOException
- Throws:
IOException
-
getDestination
protected Path getDestination(URI uri, String location) throws IOException
- Throws:
IOException
-
download
protected void download(URI uri, Path destination) throws IOException
- Throws:
IOException
-
isFilePresent
protected boolean isFilePresent(Path... paths) throws IOException
Test if any of the Paths exist (as files)- Parameters:
paths- the list of paths to check- Returns:
- true if the path exist (as a file), false if it doesn't exist
- Throws:
IOException- if the path points to a non-file, or is not readable.
-
copyDirectory
public boolean copyDirectory(Path source, Path destination) throws IOException
- Throws:
IOException
-
-