public interface Asset
Modifier and Type | Interface and Description |
---|---|
static class |
Asset.FileAsset
File system asset.
|
static class |
Asset.URLAsset
URL asset.
|
Modifier and Type | Method and Description |
---|---|
static Asset |
create(Path resource)
Creates a file system asset.
|
static Asset |
create(String path,
URL resource)
Creates a URL asset with the given path.
|
MediaType |
getContentType() |
default String |
getEtag()
Computes a weak e-tag value from asset.
|
long |
getLastModified() |
long |
getSize() |
void |
release()
Release this asset.
|
InputStream |
stream() |
static Asset create(@Nonnull Path resource)
resource
- File resource.static Asset create(@Nonnull String path, @Nonnull URL resource)
path
- Asset path.resource
- Asset URL.long getSize()
-1
if undefined.long getLastModified()
@Nonnull default String getEtag()
InputStream stream()
void release()
Copyright © 2019. All rights reserved.