Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_CHARSET
|
Modifier and Type | Method and Description |
---|---|
default void |
copyToDirectory(Path outputDirectory)
Copies this Asset to the specified 'outputDirectory'
Path . |
default void |
copyToDirectory(Path outputDirectory,
boolean overwrite)
Copies this Asset to the specified 'outputDirectory'
Path . |
default void |
copyToDirectory(Path outputDirectory,
boolean overwrite,
boolean onlyIfAbsent)
Copies this Asset to the specified 'outputDirectory'
Path . |
default void |
copyToFile(Path output)
Copies this Asset to the specified 'output'
Path . |
default void |
copyToFile(Path output,
boolean overwrite)
Copies this Asset to the specified 'output'
Path . |
default void |
copyToFile(Path output,
boolean overwrite,
boolean onlyIfAbsent)
Copies this Asset to the specified 'output'
Path . |
default String |
getFileName()
Returns the the last portion of the Asset URL, e.g.
|
PluginContainer |
getOwner()
Returns the original
Plugin owner of this Asset. |
URL |
getUrl()
Returns the
URL to this Asset. |
default byte[] |
readBytes()
Reads this Asset in it's entirety as a byte array and returns the
result.
|
default List<String> |
readLines()
Reads all lines from the asset and returns the result.
|
default List<String> |
readLines(Charset charset)
Reads all lines from the asset and returns the result.
|
default String |
readString()
Reads this Asset in it's entirety as a
String and returns the
result. |
default String |
readString(Charset charset)
Reads this Asset in it's entirety as a
String and returns the
result. |
static final Charset DEFAULT_CHARSET
PluginContainer getOwner()
Plugin
owner of this Asset.default void copyToFile(Path output) throws IOException
Path
.output
- Path to copy toIOException
- If any file exception is throwndefault void copyToFile(Path output, boolean overwrite) throws IOException
Path
.output
- Path to copy tooverwrite
- If the file should be overwritten if it existsIOException
- File exceptiondefault void copyToFile(Path output, boolean overwrite, boolean onlyIfAbsent) throws IOException
Path
.output
- Path to copy tooverwrite
- If the file should be overwritten if it existsonlyIfAbsent
- If the file should only be copied if absentIOException
- File exceptiondefault void copyToDirectory(Path outputDirectory) throws IOException
Path
.outputDirectory
- The directory to copy toIOException
- If any file exception is throwndefault void copyToDirectory(Path outputDirectory, boolean overwrite) throws IOException
Path
.outputDirectory
- The directory to copy tooverwrite
- If the file should be overwritten if it existsIOException
- File exceptiondefault void copyToDirectory(Path outputDirectory, boolean overwrite, boolean onlyIfAbsent) throws IOException
Path
.outputDirectory
- The directory to copy tooverwrite
- If the file should be overwritten if it existsonlyIfAbsent
- If the file should only be copied if absentIOException
- File exceptiondefault String getFileName()
default String readString() throws IOException
String
and returns the
result.IOException
- If any file exception is throwndefault String readString(Charset charset) throws IOException
String
and returns the
result.charset
- The charset to read the asset withIOException
- If any file exception is throwndefault List<String> readLines() throws IOException
IOException
- If any file exception is throwndefault List<String> readLines(Charset charset) throws IOException
charset
- The charset to read the asset withIOException
- If any file exception is throwndefault byte[] readBytes() throws IOException
IOException
- If any file exception is thrown