gov.noaa.mptools
Class MPRunner

java.lang.Object
  extended bygov.noaa.mptools.MPRunner

public class MPRunner
extends java.lang.Object

A java wrapper around "Metadata Parser" also known as mp written by Peter Sweitzer.


Constructor Summary
MPRunner()
          Creates a new instance of MPRunner
 
Method Summary
 java.lang.String runMPWithFileName(java.lang.String mpFile)
          This will run mp against the specified file.
 java.lang.String runMPWithXMLString(java.lang.String xml)
          this creates a file containing the specified string which is then parsed by mp
 void setAliasFile(java.lang.String alias)
          Sets the location and name of the alias file.
 void setConfigFile(java.lang.String conf)
          Sets the location and name of the conrfig file to use with mp.
 void setMPCommand(java.lang.String str)
          Sets the location and the name of the mp command.
 void setTempDir(java.lang.String tDir)
          Set the directory to place the temporary files generated by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPRunner

public MPRunner()
Creates a new instance of MPRunner

Method Detail

setTempDir

public void setTempDir(java.lang.String tDir)
Set the directory to place the temporary files generated by this class.

Parameters:
tDir - The relative or specific path.

setMPCommand

public void setMPCommand(java.lang.String str)
Sets the location and the name of the mp command.

Parameters:
str - The complete path to mp and the mp command. Or the relative path and the mp command.

setConfigFile

public void setConfigFile(java.lang.String conf)
Sets the location and name of the conrfig file to use with mp. (The -c option)

Parameters:
conf - The config file.

setAliasFile

public void setAliasFile(java.lang.String alias)
Sets the location and name of the alias file.

Parameters:
alias - the alias file.

runMPWithFileName

public java.lang.String runMPWithFileName(java.lang.String mpFile)
                                   throws MPException
This will run mp against the specified file.

Parameters:
mpFile - full path to the xmlFile to be parsed
Returns:
the output from mp
Throws:
MPException - If something goes wrong.

runMPWithXMLString

public java.lang.String runMPWithXMLString(java.lang.String xml)
                                    throws MPException
this creates a file containing the specified string which is then parsed by mp

Parameters:
xml - The xml of the record to run against mp.
Returns:
error output from mp
Throws:
MPException - If something goes wrong.


Copyright © 2004 National Oceanic and Atmospheric Administration > National Geophysical Data Center > Enterprise Data Services Division. All Rights Reserved.