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