Package de.espirit.firstspirit.generate
Interface FilenameFactory
public interface FilenameFactory
Callback interface to produce file and path names used for storage in the file system.
Instance are used in combination with an
UrlFactory
(which is consulted first).-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFilename
(String url, ContentProducer node, TemplateSet templateSet, Language language, PageParams pageParams) Calculate filename for provided combination of node, template set, language, and page params.getFilename
(String url, Media node, @Nullable Language language, @Nullable Resolution resolution) Calculate filename for provided combination of node, language, and resolution.
-
Field Details
-
DEFAULT_FACTORY
Default implementation. This just strips leading slashes and domain part ('http{s}://domain/') of the given url.- Since:
- 5.1.13
-
-
Method Details
-
getFilename
String getFilename(String url, ContentProducer node, TemplateSet templateSet, Language language, PageParams pageParams) Calculate filename for provided combination of node, template set, language, and page params.- Parameters:
url
- Absolute URL as created byUrlFactory.getUrl(ContentProducer, TemplateSet, Language, PageParams)
.node
- target node.templateSet
- target template set.language
- target language.pageParams
- the page params.- Returns:
- the complete path including extension (should not include leading slash).
- Since:
- 5.1.13
-
getFilename
String getFilename(String url, Media node, @Nullable @Nullable Language language, @Nullable @Nullable Resolution resolution) Calculate filename for provided combination of node, language, and resolution.- Parameters:
url
- Absolute URL as created byUrlFactory.getUrl(Media, Language, Resolution)
.node
- Target node.language
- Target language ornull
for language independent media nodes.resolution
- Target resolution ornull
for media nodes of typeMedia.FILE
.- Returns:
- The complete path including extension (should not include leading slash).
- Since:
- 5.1.13
-