public class DefaultMetaFilenamePolicy extends Object implements IFilenamePolicy
Constructor and Description |
---|
DefaultMetaFilenamePolicy(IFilenamePolicy filenamePolicy) |
Modifier and Type | Method and Description |
---|---|
com.google.common.base.Optional<URI> |
getBase(IAggregationEntry entry)
Tries to generate a base URI for the given aggregation entry.
|
URI |
getFilename(IAggregationEntry entry,
boolean asParent)
Generates a file name for the aggregation entry described by the given
metadata.
|
String |
getFilename(info.textgrid.namespaces.metadata.core._2010.ObjectType object,
boolean asParent)
Generates a file name candidate for the object described by the given
metadata.
|
String |
translate(String title)
Creates a valid file name part for the given string.
|
public DefaultMetaFilenamePolicy(IFilenamePolicy filenamePolicy)
public String translate(String title)
IFilenamePolicy
translate
in interface IFilenamePolicy
title
- The string that should be translatedpublic String getFilename(info.textgrid.namespaces.metadata.core._2010.ObjectType object, boolean asParent)
IFilenamePolicy
getFilename
in interface IFilenamePolicy
object
- The object with the metadata for which to generate a filenameasParent
- If true, the generated file name should be the parent for a
different filename. Implementors might, e.g., want to leave
out an extension.public URI getFilename(IAggregationEntry entry, boolean asParent) throws IllegalStateException
IFilenamePolicy
getFilename
in interface IFilenamePolicy
IllegalStateException
IFilenamePolicy.getFilename(ObjectType, boolean)
public com.google.common.base.Optional<URI> getBase(IAggregationEntry entry)
IFilenamePolicy
getBase
in interface IFilenamePolicy
Copyright © 2017 TextGrid. All rights reserved.