Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javazoom.download.util
Class ConfigHandler

    java.lang.Object
      |
      +--org.xml.sax.helpers.DefaultHandler
            |
            +--javazoom.download.util.ConfigHandler

All Implemented Interfaces:
  org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ConfigHandler
extends org.xml.sax.helpers.DefaultHandler

This class implements a SAX2 handler to read Download4J XML configuration file.

Field Summary
`static java.lang.String` | `DBPASSWORD` DBPASSWORD key for database credentials properties : Default is password
`static java.lang.String` | `DBUSER` DBUSER key for database credentials properties : Default is user
`static java.lang.String` | `DEFAULTFOLDERDOWNLOADROOT` Default DownloadRoot path (WEB-INF subfolder) : downloadroot
`static java.lang.String` | `DEFAULTIMPL` Default DownloadSource implementation for database.
`static java.lang.String` | `DEFAULTZIPDOWNLOADROOT` Default ZIP archive (WEB-INF subfolder) : downloadroot.zip

Constructor Summary
`ConfigHandler(java.lang.String configpath)` Contructs the Config handler.

Method Summary
`void` | `endDocument()` SAX2 - endDocument.
`void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)` SAX2 - endElement
`Config` | `getConfig()` Returns an instance of Config (Folder, ZIP or Database).
`java.lang.String` | `getConfigPath()` Returns path to XML configuration file.
`java.lang.String` | `getLogFolder()` Gets log folder (Default is null)
`int` | `getLogLevel()` Gets log level (Default is 0).
`void` | `startDocument()` SAX2 - startDocument.
`void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)` SAX2 - startElement.

Methods inherited from class org.xml.sax.helpers.DefaultHandler
`characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULTIMPL

    public static java.lang.String DEFAULTIMPL

  Default DownloadSource implementation for database. Default is javazoom.download.DownloadDatabaseSource

### DBUSER

    public static java.lang.String DBUSER

  DBUSER key for database credentials properties : Default is user

### DBPASSWORD

    public static java.lang.String DBPASSWORD

  DBPASSWORD key for database credentials properties : Default is password

### DEFAULTFOLDERDOWNLOADROOT

    public static java.lang.String DEFAULTFOLDERDOWNLOADROOT

  Default DownloadRoot path (WEB-INF subfolder) : downloadroot

### DEFAULTZIPDOWNLOADROOT

    public static java.lang.String DEFAULTZIPDOWNLOADROOT

  Default ZIP archive (WEB-INF subfolder) : downloadroot.zip

Constructor Detail

### ConfigHandler

    public ConfigHandler(java.lang.String configpath)

  Contructs the Config handler.

Parameters:
  `configpath` - path to XML configuration file.

Method Detail

### getConfig

    public Config getConfig()

  Returns an instance of Config (Folder, ZIP or Database).

  Returns:
    generated Config.

### getConfigPath

    public java.lang.String getConfigPath()

  Returns path to XML configuration file.

  Returns:
    path to XML configuration file.

### getLogLevel

    public int getLogLevel()

  Gets log level (Default is 0).

  Returns:
    log level

### getLogFolder

    public java.lang.String getLogFolder()

  Gets log folder (Default is null)

  Returns:
    log folder.

### startDocument

    public void startDocument()

  SAX2 - startDocument.

  Specified by:
    `startDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startDocument` in class `org.xml.sax.helpers.DefaultHandler`

### startElement

    public void startElement(java.lang.String uri,
                             java.lang.String localName,
                             java.lang.String qName,
                             org.xml.sax.Attributes attributes)

  SAX2 - startElement. Depending on folder, zip or database, it instanciates a Config object with FileInfo.

  Specified by:
    `startElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startElement` in class `org.xml.sax.helpers.DefaultHandler`
  Parameters:
    `uri` - NA
    `localName` - NA
    `qName` - XML tag name
    `attributes` - XML attributes

### endElement

    public void endElement(java.lang.String uri,
                           java.lang.String localName,
                           java.lang.String qName)

  SAX2 - endElement

  Specified by:
    `endElement` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endElement` in class `org.xml.sax.helpers.DefaultHandler`
  Parameters:
    `uri` - NA
    `localName` - NA
    `qName` - NA

### endDocument

    public void endDocument()

  SAX2 - endDocument.

  Specified by:
    `endDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endDocument` in class `org.xml.sax.helpers.DefaultHandler`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD