public class FileReference extends AbstractExternalReference implements ExternalReferenceSPI
AbstractExternalReference
to enable hibernate based persistence.Constructor and Description |
---|
FileReference()
Explicitly declare default constructor, will be used by hibernate when
constructing instances of this bean from the database.
|
FileReference(File theFile)
Construct a file reference pointed at the specified file and with no
character set defined.
|
Modifier and Type | Method and Description |
---|---|
FileReference |
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
|
ReferencedDataNature |
getDataNature()
Default to returning DataReferenceNature.UNKNOWN
|
String |
getDataNatureName() |
File |
getFile() |
String |
getFilePath()
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)
Open and return an InputStream to the data referenced using, if required,
any facilities within the supplied context.
|
void |
setCharset(String charset)
Setter used by hibernate to set the charset property of the file
reference
|
void |
setDataNature(ReferencedDataNature dataNature) |
void |
setDataNatureName(String dataNatureName) |
void |
setFilePath(String filePathString)
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.
|
getPrimaryKey, setPrimaryKey
public FileReference()
public FileReference(File theFile)
public InputStream openStream(ReferenceContext context)
openStream
in interface ExternalReferenceSPI
context
- the ReferenceContext object used to obtain e.g. security
agents or other facilities required when de-referencing this
reference.public void setCharset(String charset)
public String getCharset()
getCharset
in interface ExternalReferenceSPI
getCharset
in class AbstractExternalReference
null
if binary or unknown type.public void setFilePath(String filePathString)
public String getFilePath()
public String toString()
public Long getApproximateSizeInBytes()
ExternalReferenceSPI
getApproximateSizeInBytes
in interface ExternalReferenceSPI
public ReferencedDataNature getDataNature()
AbstractExternalReference
getDataNature
in interface ExternalReferenceSPI
getDataNature
in class AbstractExternalReference
public void setDataNature(ReferencedDataNature dataNature)
dataNature
- the dataNature to setpublic final File getFile()
public float getResolutionCost()
AbstractExternalReference
getResolutionCost
in interface ExternalReferenceSPI
getResolutionCost
in class AbstractExternalReference
public String getDataNatureName()
public void setDataNatureName(String dataNatureName)
dataNatureName
- the dataNatureName to setpublic void deleteData()
public FileReference clone()
clone
in interface ExternalReferenceSPI
clone
in class AbstractExternalReference
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.