public class HttpReference extends AbstractExternalReference implements ExternalReferenceSPI
AbstractExternalReference
to enable hibernate based persistence.Constructor and Description |
---|
HttpReference()
Explicitly declare default constructor, will be used by hibernate when
constructing instances of this bean from the database.
|
Modifier and Type | Method and Description |
---|---|
HttpReference |
clone() |
void |
deleteData() |
boolean |
equals(Object obj) |
Long |
getApproximateSizeInBytes()
Approximate size of the stored data or -1 if we do not know.
|
String |
getCharset()
Default to returning null for charset
|
URL |
getHttpUrl() |
String |
getHttpUrlString()
Getter used by hibernate to retrieve the file path string property
|
float |
getResolutionCost()
Default to a value of 0.0f for the resolution cost, but implementations
should at least attempt to set this to a more sensible level!
|
int |
hashCode() |
InputStream |
openStream(ReferenceContext context)
Return the data at the
URL represented by this external reference |
void |
setHttpUrlString(String httpUrlString)
Setter used by hibernate to set the file path property of the file
reference
|
String |
toString()
Human readable string form for debugging, should not be regarded as
stable.
|
getDataNature, getPrimaryKey, setPrimaryKey
finalize, getClass, notify, notifyAll, wait, wait, wait
getDataNature
public HttpReference()
public InputStream openStream(ReferenceContext context) throws DereferenceException
URL
represented by this external referenceopenStream
in interface ExternalReferenceSPI
context
- the ReferenceContext object used to obtain e.g. security
agents or other facilities required when de-referencing this
reference.DereferenceException
- if the reference cannot be de-referenced. This may be because
of problems with the context such as security failures, or it
may be because the reference is inherently not possible to
de-reference (as in the case of a non-serializable API
consumer reference).public String getCharset() throws DereferenceException
AbstractExternalReference
getCharset
in interface ExternalReferenceSPI
getCharset
in class AbstractExternalReference
null
if binary or unknown type.DereferenceException
public void setHttpUrlString(String httpUrlString)
ExternalReferenceValidationException
- if there is some problem parsing the supplied string as a URLpublic String getHttpUrlString()
public String toString()
public Long getApproximateSizeInBytes()
ExternalReferenceSPI
getApproximateSizeInBytes
in interface ExternalReferenceSPI
public final URL getHttpUrl()
public float getResolutionCost()
AbstractExternalReference
getResolutionCost
in interface ExternalReferenceSPI
getResolutionCost
in class AbstractExternalReference
public void deleteData()
public HttpReference clone()
clone
in interface ExternalReferenceSPI
clone
in class AbstractExternalReference
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.