org.apache.oodt.cas.metadata
Class AbstractMetExtractor

java.lang.Object
  extended by org.apache.oodt.cas.metadata.AbstractMetExtractor
All Implemented Interfaces:
MetExtractor
Direct Known Subclasses:
CmdLineMetExtractor

public abstract class AbstractMetExtractor
extends Object
implements MetExtractor

Version:
$Revision$

A core MetExtractor implementation, implementing all methods but {extractMetadata(File)

.
Author:
mattmann, bfoster

Field Summary
protected  MetExtractorConfig config
           
protected static Logger LOG
           
protected  MetExtractorConfigReader reader
           
 
Constructor Summary
AbstractMetExtractor(MetExtractorConfigReader reader)
           
 
Method Summary
 Metadata extractMetadata(File f)
          Extracts Metadata from a given File.
 Metadata extractMetadata(File f, File configFile)
          Extracts Metadata from the given File using the specified config file.
 Metadata extractMetadata(File f, MetExtractorConfig config)
          Extracts Metadata from the given File using the specified MetExtractorConfig.
 Metadata extractMetadata(File f, String configFilePath)
          Extracts Metadata from the given File using the specified config file path.
 Metadata extractMetadata(String filePath)
          Extracts Metadata from a given /path/to/some/file.
 Metadata extractMetadata(URL fileUrl)
          Extracts Metadata from a given URL pointer to a File.
 Metadata extractMetadata(URL fileUrl, MetExtractorConfig config)
          Extracts Metadata from the given URL using the specified MetExtractorConfig.
protected abstract  Metadata extrMetadata(File file)
          Extracts Metadata from the given File
 void setConfigFile(File f)
          Sets the config file for this MetExtractor to the specified File f.
 void setConfigFile(MetExtractorConfig config)
          Sets the MetExtractorConfig for the MetExtractor
 void setConfigFile(String filePath)
          Sets the config file for this MetExtractor to the specified File identified by filePath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected MetExtractorConfig config

reader

protected MetExtractorConfigReader reader

LOG

protected static final Logger LOG
Constructor Detail

AbstractMetExtractor

public AbstractMetExtractor(MetExtractorConfigReader reader)
Method Detail

extrMetadata

protected abstract Metadata extrMetadata(File file)
                                  throws MetExtractionException
Extracts Metadata from the given File

Parameters:
file - The File from which Metadata will be extracted
Returns:
The Metadata extracted
Throws:
MetExtractionException - If any error occurs

extractMetadata

public Metadata extractMetadata(File f)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from a given File.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
f - File object to extract Metadata from.
Returns:
Extracted Metadata from the given File.
Throws:
MetExtractionException - If any error occurs.

extractMetadata

public Metadata extractMetadata(String filePath)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from a given /path/to/some/file.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
filePath - Path to a given file to extract Metadata from.
Returns:
Extracted Metadata from the given filePath.
Throws:
MetExtractionException - If any error occurs.

extractMetadata

public Metadata extractMetadata(URL fileUrl)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from a given URL pointer to a File.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
fileUrl - The URL pointer to a File.
Returns:
Extracted Metadata from the given File URL.
Throws:
MetExtractionException - If any error occurs.

extractMetadata

public Metadata extractMetadata(File f,
                                File configFile)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from the given File using the specified config file.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
f - The File to extract Metadata from.
configFile - The config file for this MetExtractor.
Returns:
Extracted Metadata from the given File using the specified config file.
Throws:
MetExtractionException - If any error occurs.

extractMetadata

public Metadata extractMetadata(File f,
                                String configFilePath)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from the given File using the specified config file path.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
f - The File to extract Metadata from.
configFilePath - The path to the config file for this MetExtractor.
Returns:
Extracted Metadata from the given File using the specified config file path.
Throws:
MetExtractionException - If any error occurs.

extractMetadata

public Metadata extractMetadata(File f,
                                MetExtractorConfig config)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from the given File using the specified MetExtractorConfig.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
f - The File from which Metadata will be extracted from
config - The config file for the extractor
Returns:
Metadata extracted from the File
Throws:
MetExtractionException - If any error occurs

extractMetadata

public Metadata extractMetadata(URL fileUrl,
                                MetExtractorConfig config)
                         throws MetExtractionException
Description copied from interface: MetExtractor
Extracts Metadata from the given URL using the specified MetExtractorConfig.

Specified by:
extractMetadata in interface MetExtractor
Parameters:
fileUrl - The URL from which Metadata will be extracted from
config - The config file for the extractor
Returns:
Metadata extracted from the URL
Throws:
MetExtractionException - If any error occurs

setConfigFile

public void setConfigFile(File f)
                   throws MetExtractionException
Description copied from interface: MetExtractor
Sets the config file for this MetExtractor to the specified File f.

Specified by:
setConfigFile in interface MetExtractor
Parameters:
f - The config file for this MetExtractor.
Throws:
MetExtractionException

setConfigFile

public void setConfigFile(MetExtractorConfig config)
Description copied from interface: MetExtractor
Sets the MetExtractorConfig for the MetExtractor

Specified by:
setConfigFile in interface MetExtractor
Parameters:
config - The MetExtractorConfig

setConfigFile

public void setConfigFile(String filePath)
                   throws MetExtractionException
Description copied from interface: MetExtractor
Sets the config file for this MetExtractor to the specified File identified by filePath.

Specified by:
setConfigFile in interface MetExtractor
Parameters:
filePath - The config file path for this MetExtractor.
Throws:
MetExtractionException


Copyright © 1999-2013
Apache OODT. All Rights Reserved.