org.shredzone.repowatch.sync
Class RepoMdParser

java.lang.Object
  extended by org.shredzone.repowatch.sync.RepoMdParser

public class RepoMdParser
extends Object

Parses the repomd.xml file of a repository.

Version:
$Revision: 341 $

Constructor Summary
RepoMdParser(URL baseUrl)
          Creates a RepoMdParser.
 
Method Summary
 DatabaseLocation getDatabaseLocation(String type)
          Gets the DatabaseLocation for the given database type.
 void parse()
          Parses the repomd file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepoMdParser

public RepoMdParser(URL baseUrl)
Creates a RepoMdParser. No network connection is opened yet.

Parameters:
baseUrl - Base URL of the repository.
Method Detail

getDatabaseLocation

public DatabaseLocation getDatabaseLocation(String type)
Gets the DatabaseLocation for the given database type. parse() must be invoked once prior to this method call.

Parameters:
type - Database type (like "primary", "filelists", "other")
Returns:
DatabaseLocation to this database, or null if there was none of that type.

parse

public void parse()
           throws IOException
Parses the repomd file. This method creates an actual internet connection and parses the XML file. It must be invoked exactly once before getDatabaseLocation(String).

Throws:
IOException - The xml file could not be read or parsed for various reasons.


Copyright © 2007-2011 shredzone.org. All Rights Reserved.