Class FontDirURLConnectionFactory

java.lang.Object
org.faceless.publisher.resource.FontDirURLConnectionFactory
All Implemented Interfaces:
URLConnectionFactory

public class FontDirURLConnectionFactory extends Object implements URLConnectionFactory
A subclass of URLConnection for the "fonts" scheme, which generates a dynamic stylesheet of all fonts matching the specified path.
  • fonts:/path/to/dir
  • fonts:/path/to/dir/*.{otf,ttf}
  • Constructor Details

    • FontDirURLConnectionFactory

      public FontDirURLConnectionFactory()
  • Method Details

    • getURLConnection

      public URL2Connection getURLConnection(URL2 uri, ReportFactory reportFactory) throws IOException
      Description copied from interface: URLConnectionFactory
      Return a URLConnection for the specified URI, or null if not possible with this factory.
      Specified by:
      getURLConnection in interface URLConnectionFactory
      Parameters:
      uri - the URI
      reportFactory - the ReportFactory that owns this connection
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • supports

      public boolean supports(URL2 uri)
      Description copied from interface: URLConnectionFactory
      Return true if this factory can load the specified URI schema (eg http, ftp, jar, jdbc)
      Specified by:
      supports in interface URLConnectionFactory
      Parameters:
      uri - the URI
    • isUnchanged

      public boolean isUnchanged(URL2 uri, URL2Connection con) throws IOException
      Description copied from interface: URLConnectionFactory
      Return true if a previous resource loaded by this factory should be considered valid, based on the supplied response for a subsequent request for the same resource. As an example this method should return true if a web server returned a 304 (Not Modified). There is a default implementation which returns true.
      Specified by:
      isUnchanged in interface URLConnectionFactory
      Parameters:
      uri - the URI
      con - the URL connection
      Throws:
      IOException
    • getExpiry

      public long getExpiry(URL2 uri, URL2Connection con)
      Description copied from interface: URLConnectionFactory
      Return the absolute expiry time of the resource reeturned by the specified URLConnection, or Long.MAX_VALUE for forever. If this is not specified by the headers, the factory may still return a non-zero value to prevent content being cached forever. There is a default implementation which returns Long.MAX_VALUE;
      Specified by:
      getExpiry in interface URLConnectionFactory
      Parameters:
      uri - the URI
      con - the URL connection