public class UrlLocator extends java.lang.Object implements AssetLocator
UrlLocator
is a locator that combines a root URL
and the given path in the AssetKey to construct a new URL
that allows locating the asset.
The root path must be a valid URL
, for example,
https://www.example.com/assets/
Constructor and Description |
---|
UrlLocator() |
Modifier and Type | Method and Description |
---|---|
AssetInfo |
locate(AssetManager manager,
AssetKey key)
Request to locate an asset.
|
void |
setRootPath(java.lang.String rootPath) |
public void setRootPath(java.lang.String rootPath)
setRootPath
in interface AssetLocator
rootPath
- The root path where to look for assets.
Typically, this method will only be called once for each
instance of an asset locator.public AssetInfo locate(AssetManager manager, AssetKey key)
AssetLocator
AssetInfo
implementation provided should have a proper
return value for its AssetInfo.openStream()
method.locate
in interface AssetLocator
manager
- for managing assetskey
- identifies the asset to be locatedAssetInfo
that was located, or null if not found.