org.openlca.dataconversion
Class LCADocumentOutputter

java.lang.Object
  extended by org.openlca.dataconversion.LCADocumentOutputter

public class LCADocumentOutputter
extends java.lang.Object

Provides methods for (LCA) File and Document output.

Version:
1.0
Author:
Michael Srocka, GreenDeltaTC, for the openLCA project (www.openlca.org)

Constructor Summary
LCADocumentOutputter()
          Creates a new instance of LCADocumentOutputter.
 
Method Summary
 java.io.File output(org.jdom.Document document, java.lang.String newFileName, java.io.File targetDir, int type)
          Saves a given XML document.
 java.io.File output(java.io.File file, java.lang.String newFileName, java.io.File targetDir, int type)
          Copies a given file to a target directory.
 void prepareDirectory(java.io.File targetDir, int formatKey)
          Creates a format specific directory structure in the given target directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCADocumentOutputter

public LCADocumentOutputter()
Creates a new instance of LCADocumentOutputter.

Method Detail

output

public java.io.File output(org.jdom.Document document,
                           java.lang.String newFileName,
                           java.io.File targetDir,
                           int type)
                    throws ConverterException
Saves a given XML document.

Parameters:
document - Document to save.
newFileName - Name of the new file.
targetDir - Target directory of the new file.
type - LCA document type of the new file.
Returns:
New created File.
Throws:
ConverterException

output

public java.io.File output(java.io.File file,
                           java.lang.String newFileName,
                           java.io.File targetDir,
                           int type)
                    throws ConverterException
Copies a given file to a target directory.

Parameters:
file - Input file.
newFileName - Name of the new file.
targetDir - Target directory.
type - LCA document type of the new file.
Returns:
New created File.
Throws:
ConverterException

prepareDirectory

public void prepareDirectory(java.io.File targetDir,
                             int formatKey)
                      throws org.jdom.JDOMException,
                             java.io.IOException,
                             ConverterException
Creates a format specific directory structure in the given target directory.

Parameters:
targetDir - Target directory as File.
formatKey - Type key of the data format (0 = EcoSpold, 1 = ELCD, 2 = ISO).
Throws:
org.jdom.JDOMException
java.io.IOException
ConverterException