public class EmbeddedResource extends Object
| Constructor and Description |
|---|
EmbeddedResource(String embeddedPath) |
| Modifier and Type | Method and Description |
|---|---|
Path |
extract(Path destinationDir) |
Path |
extract(Path destinationDir,
boolean forceOverwrite)
Convenience method.
|
Path |
extract(Path destinationDir,
String destFilename,
boolean forceOverwrite)
Convenience method.
|
Path |
extract(Path destDir,
String destinationFilename,
int bufferSize,
boolean forceOverwrite)
Extracts this embedded resource into a local file.
|
InputStream |
getInputStream()
Returns the input stream to access this embedded resource (inside application JAR).
|
String |
getMd5Checksum()
Convenience method.
|
String |
getMd5Checksum(int bufferSize)
Returns the MD5 of this embedded resource.
|
String |
getPath() |
URL |
getUrl() |
public EmbeddedResource(String embeddedPath) throws Path.PathAccessException
Path.PathAccessExceptionpublic String getPath()
public URL getUrl()
public InputStream getInputStream()
public String getMd5Checksum(int bufferSize) throws Path.PathAccessException
bufferSize - buffer sizePath.PathAccessException - if an error happened during the calculation.public final String getMd5Checksum() throws Path.PathAccessException
Path.PathAccessExceptionpublic Path extract(Path destDir, String destinationFilename, int bufferSize, boolean forceOverwrite) throws Path.PathAccessException
destDir - directory where embedded resource should be extracted.destinationFilename - filename of extracted resource.bufferSize - read buffer size.forceOverwrite - defines if an existing resource should be overwritten.Path.PathAccessException - if an error happened during the process.public final Path extract(Path destinationDir, String destFilename, boolean forceOverwrite) throws Path.PathAccessException
Path.PathAccessExceptionpublic final Path extract(Path destinationDir, boolean forceOverwrite) throws Path.PathAccessException
Path.PathAccessExceptionpublic final Path extract(Path destinationDir) throws Path.PathAccessException
Path.PathAccessExceptionCopyright © 2016 Leandro José Britto de Oliveira. All rights reserved.