Package org.craftercms.engine.util.url
Class ContentStoreUrlConnection
- java.lang.Object
-
- java.net.URLConnection
-
- org.craftercms.engine.util.url.ContentStoreUrlConnection
-
public class ContentStoreUrlConnection extends URLConnection
Implementation ofURLConnection
that wraps aContent
.- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
connected
protected org.craftercms.core.service.Content
content
protected String
contentType
protected Map<String,String>
headers
protected boolean
initializedHeaders
protected InputStream
is
protected long
lastModified
protected long
length
-
Fields inherited from class java.net.URLConnection
allowUserInteraction, doInput, doOutput, ifModifiedSince, url, useCaches
-
-
Constructor Summary
Constructors Constructor Description ContentStoreUrlConnection(URL url, org.craftercms.core.service.Content content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
int
getContentLength()
String
getHeaderField(int n)
String
getHeaderField(String name)
String
getHeaderFieldKey(int n)
InputStream
getInputStream()
long
getLastModified()
protected void
initializeHeaders()
-
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
-
-
-
-
Field Detail
-
content
protected org.craftercms.core.service.Content content
-
contentType
protected String contentType
-
length
protected long length
-
lastModified
protected long lastModified
-
is
protected InputStream is
-
connected
protected boolean connected
-
initializedHeaders
protected boolean initializedHeaders
-
-
Constructor Detail
-
ContentStoreUrlConnection
public ContentStoreUrlConnection(URL url, org.craftercms.core.service.Content content)
-
-
Method Detail
-
connect
public void connect() throws IOException
- Specified by:
connect
in classURLConnection
- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStream
in classURLConnection
- Throws:
IOException
-
initializeHeaders
protected void initializeHeaders()
-
getHeaderField
public String getHeaderField(String name)
- Overrides:
getHeaderField
in classURLConnection
-
getHeaderField
public String getHeaderField(int n)
- Overrides:
getHeaderField
in classURLConnection
-
getHeaderFieldKey
public String getHeaderFieldKey(int n)
- Overrides:
getHeaderFieldKey
in classURLConnection
-
getContentLength
public int getContentLength()
- Overrides:
getContentLength
in classURLConnection
-
getLastModified
public long getLastModified()
- Overrides:
getLastModified
in classURLConnection
-
-