Package org.faceless.publisher.resource
Class FileURLConnectionFactory
java.lang.Object
org.faceless.publisher.resource.FileURLConnectionFactory
- All Implemented Interfaces:
URLConnectionFactory
A URLConnectionFactory that handles the "jar" and "file"
URLs, ie. those handled by Java by default.
All URLs loaded by this Factory are trusted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetExpiry(URL2 uri, URL2Connection con) Return the absolute expiry time of the resource reeturned by the specified URLConnection, or Long.MAX_VALUE for forever.getURLConnection(URL2 uri, ReportFactory reportFactory) Return a URLConnection for the specified URI, or null if not possible with this factory.booleanReturn true if the supplied URL (which will be loadable by this Factory) should be considered trusted.booleanisUnchanged(URL2 uri, URL2Connection con) 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.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, getURLConnectionProcessors, isEgressRequired, setURLConnectionProcessors
-
Constructor Details
-
FileURLConnectionFactory
public FileURLConnectionFactory()
-
-
Method Details
-
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
-
isUnchanged
Description copied from interface:URLConnectionFactoryReturn 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:
isUnchangedin interfaceURLConnectionFactory- Parameters:
uri- the URIcon- the URL connection- Throws:
IOException
-
getExpiry
Description copied from interface:URLConnectionFactoryReturn 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:
getExpiryin interfaceURLConnectionFactory- Parameters:
uri- the URIcon- the URL connection
-
isTrusted
Description copied from interface:URLConnectionFactoryReturn true if the supplied URL (which will be loadable by this Factory) should be considered trusted. The default implementation returns false.- Specified by:
isTrustedin interfaceURLConnectionFactory- See Also:
-