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 URL2
create
(MediaType mediaType, InputStream data, URL2 source) Create a data URIstatic URL2
Create a data URIgetURLConnection
(URL2 uri, ReportFactory reportFactory) Return a URLConnection for the specified URI, or null if not possible with this factory.boolean
isEgressRequired
(URL2 uri) Return true if egress is potentially required to retrieve this URL.boolean
Return 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, wait
Methods 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:URLConnectionFactory
Return a URLConnection for the specified URI, or null if not possible with this factory.- Specified by:
getURLConnection
in interfaceURLConnectionFactory
- Parameters:
uri
- the URIreportFactory
- the ReportFactory that owns this connection- Throws:
IOException
-
toString
-
supports
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 interfaceURLConnectionFactory
- Parameters:
uri
- the URI- Returns:
- whether the URL is supported by this factory
-
isEgressRequired
Description copied from interface:URLConnectionFactory
Return true if egress is potentially required to retrieve this URL. There is a default implementation which returns true.- Specified by:
isEgressRequired
in interfaceURLConnectionFactory
- Parameters:
uri
- the URI- Returns:
- whether egress is required
-