Package com.djrapitops.plan.storage.file
Class JarResource
- java.lang.Object
-
- com.djrapitops.plan.storage.file.JarResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JarResource.StreamFunction
static interface
JarResource.StreamSupplier
-
Constructor Summary
Constructors Constructor Description JarResource(java.lang.String resourceName, JarResource.StreamFunction streamFunction)
JarResource(java.lang.String resourceName, JarResource.StreamSupplier streamSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
asBytes()
java.io.InputStream
asInputStream()
Get the resource as an InputStream.java.util.List<java.lang.String>
asLines()
Get the resource as lines.java.lang.String
asString()
Get the resource as a String with each line separated by CRLF newline characters\r\n
.java.lang.String
getResourceName()
Get the name of this Resource.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.djrapitops.plan.storage.file.Resource
asWebResource
-
-
-
-
Constructor Detail
-
JarResource
public JarResource(java.lang.String resourceName, JarResource.StreamSupplier streamSupplier)
-
JarResource
public JarResource(java.lang.String resourceName, JarResource.StreamFunction streamFunction)
-
-
Method Detail
-
asInputStream
public java.io.InputStream asInputStream() throws java.io.IOException
Description copied from interface:Resource
Get the resource as an InputStream.- Specified by:
asInputStream
in interfaceResource
- Returns:
- InputStream of the resource, not closed automatically.
- Throws:
java.io.IOException
- If the resource is unavailable.
-
asLines
public java.util.List<java.lang.String> asLines() throws java.io.IOException
Description copied from interface:Resource
Get the resource as lines.
-
asString
public java.lang.String asString() throws java.io.IOException
Description copied from interface:Resource
Get the resource as a String with each line separated by CRLF newline characters\r\n
.
-
asBytes
public byte[] asBytes() throws java.io.IOException
-
getResourceName
public java.lang.String getResourceName()
Description copied from interface:Resource
Get the name of this Resource.- Specified by:
getResourceName
in interfaceResource
- Returns:
- Relative file path given to
PlanFiles
.
-
-