Package com.djrapitops.plan.storage.file
Class FileResource
- java.lang.Object
-
- com.djrapitops.plan.storage.file.FileResource
-
-
Constructor Summary
Constructors Constructor Description FileResource(java.lang.String resourceName, java.io.File file)
-
Method Summary
All Methods Static 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.static java.util.List<java.lang.String>
lines(java.io.File file)
-
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
-
-
-
-
Method Detail
-
lines
public static java.util.List<java.lang.String> lines(java.io.File file) throws java.io.IOException
- 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
.
-
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.
-
asBytes
public byte[] asBytes() throws java.io.IOException
-
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
.
-
-