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).
Since:
5.1.13
See Also:
  • Field Details

    • DEFAULT_FACTORY

      static final FilenameFactory 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 by UrlFactory.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 by UrlFactory.getUrl(Media, Language, Resolution).
      node - Target node.
      language - Target language or null for language independent media nodes.
      resolution - Target resolution or null for media nodes of type Media.FILE.
      Returns:
      The complete path including extension (should not include leading slash).
      Since:
      5.1.13