public class DefaultMediaPackageSerializerImpl extends Object implements MediaPackageSerializer
MediaPackageSerializer that is able to deal with relative urls in manifest.| Modifier and Type | Field and Description |
|---|---|
protected URL |
packageRoot
Optional package root file
|
static int |
RANKING
It's very likely that this should be the first serializer when encoding an URI, therefore choose a high ranking
|
| Constructor and Description |
|---|
DefaultMediaPackageSerializerImpl()
Creates a new package serializer that will work completely transparent, therefore resolving urls by simply
returning them as is.
|
DefaultMediaPackageSerializerImpl(File packageRoot)
Creates a new package serializer that enables the resolution of relative urls from the manifest by taking
packageRoot as the root directory. |
DefaultMediaPackageSerializerImpl(URL packageRoot)
Creates a new package serializer that enables the resolution of relative urls from the manifest by taking
packageRoot as the root url. |
| Modifier and Type | Method and Description |
|---|---|
URI |
decodeURI(URI uri)
This serializer implementation tries to cope with relative urls.
|
URI |
encodeURI(URI uri)
This serializer implementation tries to cope with relative urls.
|
URL |
getPackageRoot()
Returns the package root that is used determine and resolve relative paths.
|
int |
getRanking()
Identifies the serializer ranking number.
|
void |
setPackageRoot(URL packageRoot)
Sets the package root.
|
protected URL packageRoot
public static final int RANKING
public DefaultMediaPackageSerializerImpl()
public DefaultMediaPackageSerializerImpl(URL packageRoot)
packageRoot as the root url.packageRoot - the root urlpublic DefaultMediaPackageSerializerImpl(File packageRoot) throws MalformedURLException
packageRoot as the root directory.packageRoot - the root urlMalformedURLException - if the file cannot be converted to a urlpublic URL getPackageRoot()
null.public void setPackageRoot(URL packageRoot)
packageRoot - the packageRoot to setgetPackageRoot()public URI encodeURI(URI uri) throws URISyntaxException
null, the serializer will try to convert element urls to relative paths if possible. .encodeURI in interface MediaPackageSerializeruri - the url to encodeURISyntaxException - if the resulting URI contains syntax errorsMediaPackageSerializer.encodeURI(URI)public URI decodeURI(URI uri) throws URISyntaxException
Note that for absolute paths without a protocol, the file:// protocol is assumed.
decodeURI in interface MediaPackageSerializeruri - the original path from the manifestURISyntaxException - if the path cannot be converted into a urlDefaultMediaPackageSerializerImpl(URL),
MediaPackageSerializer.decodeURI(URI)public int getRanking()
MediaPackageSerializergetRanking in interface MediaPackageSerializerCopyright © 2009–2020 Opencast Project. All rights reserved.