public abstract class FileInitializer extends Object
Modifier and Type | Field and Description |
---|---|
protected BaseHome |
_basehome |
protected Set<String> |
_scheme |
Modifier | Constructor and Description |
---|---|
protected |
FileInitializer(BaseHome basehome,
String... scheme) |
Modifier and Type | Method and Description |
---|---|
boolean |
check(URI uri,
String location) |
boolean |
copyDirectory(Path source,
Path destination) |
abstract boolean |
create(URI uri,
String location)
Initialize a file resource
|
protected void |
download(URI uri,
Path destination) |
protected Path |
getDestination(URI uri,
String location) |
boolean |
isApplicable(URI uri) |
protected boolean |
isFilePresent(Path... paths)
Test if any of the Paths exist (as files)
|
protected final BaseHome _basehome
public boolean isApplicable(URI uri)
public abstract boolean create(URI uri, String location) throws IOException
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}) *IOException
- if there was an attempt to initialize, but an error occurred.public boolean check(URI uri, String location) throws IOException
IOException
protected Path getDestination(URI uri, String location) throws IOException
IOException
protected void download(URI uri, Path destination) throws IOException
IOException
protected boolean isFilePresent(Path... paths) throws IOException
paths
- the list of paths to checkIOException
- if the path points to a non-file, or is not readable.public boolean copyDirectory(Path source, Path destination) throws IOException
IOException
Copyright © 1995–2017 Webtide. All rights reserved.