ClasspathAsset
final class ClasspathAsset
Extends: Asset
Package: dev.joid.lib.asset.impl · Module: core · Source: ClasspathAsset.java
An asset found in the classpath, such as a file packed in the jar of your application.
Description
Section titled “Description”A String path without a scheme gives one when the classpath has it, with or without a leading /; its id is classpath: followed by the path.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
ClasspathAsset | of(String path, URL url) factory | Creates the asset of the classpath path, read from url. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
InputStream | open() | Opens the URL of the resource. |
File | getFile() | Returns the file when the classpath entry is a folder on disk, or null inside a jar. |
URL | getUrl() | Returns the URL the asset is read from. |
String | getPath() | Returns the classpath path, without a leading /. |
Creation details
Section titled “Creation details”ClasspathAsset of(String path, URL url) factory
Creates the asset of the classpath path, read from url.
Method details
Section titled “Method details”InputStream open()
Opens the URL of the resource.
getFile
Section titled “getFile”File getFile()
Returns the file when the classpath entry is a folder on disk, or null inside a jar.
getUrl
Section titled “getUrl”URL getUrl()
Returns the URL the asset is read from.
getPath
Section titled “getPath”String getPath()
Returns the classpath path, without a leading /.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
