cdox.edit
Class CDoxLoader

java.lang.Object
  extended bycdox.edit.CDoxLoader
All Implemented Interfaces:
CDCoverStandards

public class CDoxLoader
extends java.lang.Object
implements CDCoverStandards

This is a class to load a CDox file from a stream/file whatever and to reconstruct the Cover and Data objects that are stored within it. If the parse method is invoked a second time, the previous stored Cover and Data objects will be lost.

A CDoxLoader can be used several times by simply calling the parse method. The expected format of the parse method is of course a zip file format containing the documents.cdx file, corresponding to the file format defined in the fileformat.xsd. For more information, refer to the developer pages that can be found on our homepage.

Author:
Rutger Bezema, Andreas Schmitz

Field Summary
 
Fields inherited from interface cdox.edit.CDCoverStandards
ALL, CDBACK_SIDE, CDBACK_SIDE_SIZE, CDBACK_SIZE, CDBOOKLET, CDBOOKLET_SIZE, CDFRONT, CDFRONT_SIZE, CDSIDE_SIZE, CDX, GIF, JPG, PNG
 
Constructor Summary
CDoxLoader()
          Constructs new loader.
 
Method Summary
 Cover[] getCovers()
          Returns the parsed covers.
 Data getData()
          Returns the parsed data or null, if none was found.
 void parse(java.io.File f)
          Parses the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDoxLoader

public CDoxLoader()
           throws javax.xml.parsers.ParserConfigurationException
Constructs new loader.

Throws:
javax.xml.parsers.ParserConfigurationException - if XML does not work correctly in the implementation of the JRE/JDK/whatever.
Method Detail

parse

public void parse(java.io.File f)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Parses the file.

Parameters:
f - the file to parse.
Throws:
java.io.IOException - if the location is not readable.
org.xml.sax.SAXException - if the documents.cdx is no valid cdx XML file.

getCovers

public Cover[] getCovers()
Returns the parsed covers.

Returns:
an array containing the covers.

getData

public Data getData()
Returns the parsed data or null, if none was found.

Returns:
the data.