Class DataURLConnectionFactory

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

public class DataURLConnectionFactory extends Object implements URLConnectionFactory
A subclass of URLConnection that can be used to read from "data" URLs.
  • Constructor Details

    • DataURLConnectionFactory

      public DataURLConnectionFactory()
  • Method Details

    • create

      public static URL2 create(MediaType mediaType, String data, Origin origin)
      Create a data URI
      Parameters:
      mediaType - the content type
      data - the content, which will not be base-64 encoded
      origin - the origin for this data URI
    • create

      public static URL2 create(MediaType mediaType, InputStream data, Origin origin) throws IOException
      Create a data URI
      Parameters:
      mediaType - the content type
      data - the content, which will be base-64 encoded
      origin - the origin for this data URI
      Throws:
      IOException
    • 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