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 java.lang.ObjectInterface for initializing a file resource.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFileInitializer(BaseHome basehome, java.lang.String... scheme)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancheck(java.net.URI uri, java.lang.String location)booleancopyDirectory(java.nio.file.Path source, java.nio.file.Path destination)abstract booleancreate(java.net.URI uri, java.lang.String location)Initialize a file resourceprotected voiddownload(java.net.URI uri, java.nio.file.Path destination)protected java.nio.file.PathgetDestination(java.net.URI uri, java.lang.String location)booleanisApplicable(java.net.URI uri)protected booleanisFilePresent(java.nio.file.Path... paths)Test if any of the Paths exist (as files)
-
-
-
Field Detail
-
_scheme
protected final java.util.Set<java.lang.String> _scheme
-
_basehome
protected final BaseHome _basehome
-
-
Constructor Detail
-
FileInitializer
protected FileInitializer(BaseHome basehome, java.lang.String... scheme)
-
-
Method Detail
-
isApplicable
public boolean isApplicable(java.net.URI uri)
-
create
public abstract boolean create(java.net.URI uri, java.lang.String location) throws java.io.IOExceptionInitialize 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:
java.io.IOException- if there was an attempt to initialize, but an error occurred.
-
check
public boolean check(java.net.URI uri, java.lang.String location) throws java.io.IOException- Throws:
java.io.IOException
-
getDestination
protected java.nio.file.Path getDestination(java.net.URI uri, java.lang.String location) throws java.io.IOException- Throws:
java.io.IOException
-
download
protected void download(java.net.URI uri, java.nio.file.Path destination) throws java.io.IOException- Throws:
java.io.IOException
-
isFilePresent
protected boolean isFilePresent(java.nio.file.Path... paths) throws java.io.IOExceptionTest 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:
java.io.IOException- if the path points to a non-file, or is not readable.
-
copyDirectory
public boolean copyDirectory(java.nio.file.Path source, java.nio.file.Path destination) throws java.io.IOException- Throws:
java.io.IOException
-
-