Package org.faceless.publisher.resource
Class DataURLConnectionFactory
java.lang.Object
org.faceless.publisher.resource.DataURLConnectionFactory
- All Implemented Interfaces:
URLConnectionFactory
A subclass of URLConnection that can be used to read from "data" URLs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URL2create(MediaType mediaType, InputStream data, URL2 source) Create a data URIstatic URL2Create a data URIgetURLConnection(URL2 uri, ReportFactory reportFactory) Return a URLConnection for the specified URI, or null if not possible with this factory.booleanisEgressRequired(URL2 uri) Return true if egress is potentially required to retrieve this URL.booleanReturn true if this factory can load the specified URI schema (eg http, ftp, jar, jdbc)toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.faceless.publisher.resource.URLConnectionFactory
close, getExpiry, getURLConnectionProcessors, isTrusted, isUnchanged, setURLConnectionProcessors
-
Constructor Details
-
DataURLConnectionFactory
public DataURLConnectionFactory()
-
-
Method Details
-
create
Create a data URI- Parameters:
mediaType- the content typedata- the content, which will not be base-64 encodedorigin- the origin for this data URI
-
create
Create a data URI- Parameters:
mediaType- the content typedata- the content, which will be base-64 encodedorigin- the origin for this data URI- Throws:
IOException
-
getURLConnection
Description copied from interface:URLConnectionFactoryReturn a URLConnection for the specified URI, or null if not possible with this factory.- Specified by:
getURLConnectionin interfaceURLConnectionFactory- Parameters:
uri- the URIreportFactory- the ReportFactory that owns this connection- Throws:
IOException
-
toString
-
supports
Description copied from interface:URLConnectionFactoryReturn true if this factory can load the specified URI schema (eg http, ftp, jar, jdbc)- Specified by:
supportsin interfaceURLConnectionFactory- Parameters:
uri- the URI- Returns:
- whether the URL is supported by this factory
-
isEgressRequired
Description copied from interface:URLConnectionFactoryReturn true if egress is potentially required to retrieve this URL. There is a default implementation which returns true.- Specified by:
isEgressRequiredin interfaceURLConnectionFactory- Parameters:
uri- the URI- Returns:
- whether egress is required
-