Package com.djrapitops.plan.storage.file
Class JarResource
java.lang.Object
com.djrapitops.plan.storage.file.JarResource
- All Implemented Interfaces:
Resource
Resource implementation for something that is read via InputStream.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
ConstructorsConstructorDescriptionJarResource(String resourceName, JarResource.StreamFunction streamFunction, LongSupplier lastModifiedSupplier) JarResource(String resourceName, JarResource.StreamSupplier streamSupplier, LongSupplier lastModifiedSupplier) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.djrapitops.plan.storage.file.Resource
asParsed, asWebResource
-
Constructor Details
-
JarResource
public JarResource(String resourceName, JarResource.StreamSupplier streamSupplier, LongSupplier lastModifiedSupplier) -
JarResource
public JarResource(String resourceName, JarResource.StreamFunction streamFunction, LongSupplier lastModifiedSupplier)
-
-
Method Details
-
getLastModifiedDate
public long getLastModifiedDate()- Specified by:
getLastModifiedDatein interfaceResource
-
asInputStream
Description copied from interface:ResourceGet the resource as an InputStream.- Specified by:
asInputStreamin interfaceResource- Returns:
- InputStream of the resource, not closed automatically.
- Throws:
IOException- If the resource is unavailable.
-
asLines
Description copied from interface:ResourceGet the resource as lines.- Specified by:
asLinesin interfaceResource- Returns:
- Lines of the resource file.
- Throws:
IOException- If the resource is unavailable.
-
asString
Description copied from interface:ResourceGet the resource as a String with each line separated by CRLF newline characters\r\n.- Specified by:
asStringin interfaceResource- Returns:
- Flat string with each line separated by
\r\n. - Throws:
IOException- If the resource is unavailable.
-
asBytes
- Specified by:
asBytesin interfaceResource- Throws:
IOException
-
getResourceName
Description copied from interface:ResourceGet the name of this Resource.- Specified by:
getResourceNamein interfaceResource- Returns:
- Relative file path given to
PlanFiles.
-