public interface Asset extends AutoCloseable
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() |
boolean |
isDirectory() |
InputStream |
stream() |
close
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()
boolean isDirectory()
@Nonnull default String getEtag()
InputStream stream()
Copyright © 2020. All rights reserved.