|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.resource.Resource_ImplBase
org.apache.uima.resource.impl.ConfigurableDataResource_impl
public class ConfigurableDataResource_impl
A simple DataResource
implementation that can read data from a file via a URL. There is
an attribute for specifying the location of a local cache for a remote file, but this is not
currently being used.
Field Summary |
---|
Fields inherited from interface org.apache.uima.resource.DataResource |
---|
PARAM_RELATIVE_PATH_RESOLVER |
Fields inherited from interface org.apache.uima.resource.Resource |
---|
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_PARAM_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT |
Constructor Summary | |
---|---|
ConfigurableDataResource_impl()
|
Method Summary | |
---|---|
void |
destroy()
Releases all resources held by this Resource . |
boolean |
equals(java.lang.Object obj)
Determines if this DataResource is equal to another DataResource . |
java.io.InputStream |
getInputStream()
Gets an InputStream to the data. |
protected java.io.File |
getLocalCache()
Gets the file name of the local cache for a remote resource file, if any. |
java.net.URI |
getUri()
Gets the URI of the data. |
java.net.URL |
getUrl()
Gets the URL where the data is stored. |
int |
hashCode()
Gest the hash code for this DataResource . |
boolean |
initialize(ResourceSpecifier aSpecifier,
java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
Initializes this DataResource. |
Methods inherited from class org.apache.uima.resource.Resource_ImplBase |
---|
getCasManager, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.uima.resource.Resource |
---|
getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger |
Constructor Detail |
---|
public ConfigurableDataResource_impl()
Method Detail |
---|
public boolean initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
initialize
in interface Resource
initialize
in class Resource_ImplBase
aSpecifier
- describes how to create this DataResource. Must (at least for now) be a
FileResourceSpecifier
.aAdditionalParams
- not currently used
ResourceSpecifier
.
ResourceInitializationException
- if a failure occurs during initialization.org.apache.uima.resource.Resource#initialize(ResourceSpecifier)
public void destroy()
Resource
Resource
.
destroy
in interface Resource
destroy
in class Resource_ImplBase
Resource.destroy()
public java.io.InputStream getInputStream() throws java.io.IOException
DataResource
InputStream
to the data. It is the caller's responsibility to close this input
stream when finshed with it.
getInputStream
in interface DataResource
java.io.IOException
- if an I/O error occurred when trying to open the streamDataResource.getInputStream()
public java.net.URI getUri()
DataResource
DataResource.getUrl()
. However, in the case where DataResource.getUrl()
returns null
(indicating no URL available), this method may still return a URI. This can be the case if the
URI does not use a standard protocol such as http or file.
getUri
in interface DataResource
public java.net.URL getUrl()
DataResource
DataResource.getInputStream()
method be used whenever possible - see the class comment for more
information.
getUrl
in interface DataResource
DataResource.getUrl()
protected java.io.File getLocalCache()
public boolean equals(java.lang.Object obj)
DataResource
DataResource
is equal to another DataResource
.
It is important that DataResource
implementations override this method
appropriately, because the ResourceManager
can make use of this method to determine
when cached data can be reused. Two DataResource
s that are equal
according to this method will be considered to provide access to the same data; therefore, a
common cache can be used.
equals
in interface DataResource
equals
in class java.lang.Object
obj
- the object to compare to
aObj
is a DataResource
and provides
access to the same data as this object.DataResource.equals(java.lang.Object)
public int hashCode()
DataResource
DataResource
. As always, if the
DataResource.equals(Object)
method is overridden, this method should also be overridden. Two
objects that are equal
must have the same hash code.
hashCode
in interface DataResource
hashCode
in class java.lang.Object
DataResource.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |