public interface AssetSource
Asset
. There are two implementations:
create(Path)
.create(ClassLoader, String)
.Modifier and Type | Method and Description |
---|---|
static AssetSource |
create(ClassLoader loader,
String location)
Classpath asset source.
|
static AssetSource |
create(Path location)
Creates a source from given location.
|
Asset |
resolve(String path)
Resolve an asset using the given path.
|
static AssetSource |
webjars(ClassLoader loader,
String name)
Creates a webjar asset source.
|
@Nullable Asset resolve(@Nonnull String path)
path
- Path to look for.null
.@Nonnull static AssetSource create(@Nonnull ClassLoader loader, @Nonnull String location)
loader
- Class loader.location
- Classpath location.@Nonnull static AssetSource webjars(@Nonnull ClassLoader loader, @Nonnull String name)
asset("/path/*", AssetSource.webjar(getClassLoader(), "swagger-ui"));
loader
- Class loader.name
- Web asset name.@Nonnull static AssetSource create(@Nonnull Path location)
location
- Asset directory.Copyright © 2020. All rights reserved.