public abstract class AbstractHttpFile extends AbstractHttpResource implements HttpFile
HttpFile
implementation.Modifier and Type | Field and Description |
---|---|
protected Charset |
charset
|
protected String |
contentEncoding
Content-Encoding . |
protected String |
contentType
Content-Type . |
resourcePath
Constructor and Description |
---|
AbstractHttpFile(String resourcePath,
AbstractHttpFileDescription description)
Initiate an existing
HttpFile . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Charset |
getCharset()
Obtains the
Charset for the contents. |
String |
getContentEncoding()
Obtains the
Content-Encoding for this HttpFile . |
String |
getContentType()
Obtains the
Content-Type for this HttpFile . |
int |
hashCode() |
boolean |
isExist()
Indicates if this
HttpResource exists. |
static void |
writeHttpFile(HttpFile file,
HttpResponse response)
Writes the
HttpFile to the HttpResponse . |
getPath
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getContents
getPath
protected String contentEncoding
Content-Encoding
.protected String contentType
Content-Type
.protected transient Charset charset
public AbstractHttpFile(String resourcePath, AbstractHttpFileDescription description)
HttpFile
.resourcePath
- Resource path.description
- AbstractHttpFileDescription
.public static void writeHttpFile(HttpFile file, HttpResponse response) throws IOException
HttpFile
to the HttpResponse
.file
- HttpFile
to write to the HttpResponse
.response
- HttpResponse
IOException
- If fails to write the HttpFile
.public boolean isExist()
HttpResource
Indicates if this HttpResource
exists. Should this
HttpResource
not exist, only the path will be available.
This allows for caching of HttpResource
instances not existing.
It also enables implementations of ManagedObjectSource
instances
to provide the HttpResource
from a HttpRequest
dependency
- can always provide an instance with this indicating if exists.
isExist
in interface HttpResource
true
if this HttpResource
exists.public String getContentEncoding()
HttpFile
Content-Encoding
for this HttpFile
.getContentEncoding
in interface HttpFile
Content-Encoding
for this HttpFile
.public String getContentType()
HttpFile
Obtains the Content-Type
for this HttpFile
.
The value should omit the charset
attribute.
getContentType
in interface HttpFile
Content-Type
for this HttpFile
.public Charset getCharset()
HttpFile
Charset
for the contents.getCharset
in interface HttpFile
Charset
or null
if contents are not text or
the Charset
is unknown.public boolean equals(Object obj)
equals
in class AbstractHttpResource
public int hashCode()
hashCode
in class AbstractHttpResource
Copyright © 2005–2016. All rights reserved.