- All Superinterfaces:
AutoCloseable
Represent an static resource file. Asset from file system and classpath are supported.
- Since:
- 2.0.0
- Author:
- edgar
-
Method Summary
Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
create
Creates a file system asset.- Parameters:
resource
- File resource.- Returns:
- File resource asset.
-
create
Creates a URL asset with the given path.- Parameters:
path
- Asset path.resource
- Asset URL.- Returns:
- URL asset.
-
getSize
long getSize()- Returns:
- Asset size (in bytes) or
-1
if undefined.
-
getLastModified
long getLastModified()- Returns:
- The last modified date if possible or -1 when isn't.
-
isDirectory
boolean isDirectory()- Returns:
- True if the asset is a directory (when possible).
-
getEtag
Computes a weak e-tag value from asset.- Returns:
- A weak e-tag.
-
getContentType
- Returns:
- Asset media type.
-
stream
InputStream stream()- Returns:
- Asset content.
-