Package com.djrapitops.plan.storage.file
Class StringCachingResource
- java.lang.Object
-
- com.djrapitops.plan.storage.file.StringCachingResource
-
- All Implemented Interfaces:
Resource
public class StringCachingResource extends java.lang.Object implements Resource
Resource decorator to cache result of asString method call inResourceCache
.
-
-
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
-
-
-
-
Method Detail
-
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.
-
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
.
-
-