org.rhq.enterprise.server.plugins.url
Class SimpleIndexParser
java.lang.Object
org.rhq.enterprise.server.plugins.url.SimpleIndexParser
- All Implemented Interfaces:
- IndexParser
public class SimpleIndexParser
- extends java.lang.Object
- implements IndexParser
Parses the simple index txt file whose format is simply "location|md5" where location
is a relative filepath where the file is found on the content source.
- Author:
- John Mazzitelli
|
Method Summary |
protected static void |
generatePackageIndex(java.io.File file,
java.io.PrintWriter indexWriter,
java.io.File root)
|
static void |
main(java.lang.String[] args)
A utility that can build an index file that contains metadata for content found
in a given directory. |
java.util.Map<java.lang.String,RemotePackageInfo> |
parse(java.io.InputStream indexStream,
UrlProvider contentSource)
Given an input stream containing the index data, this will parse that data and return
the parsed information. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleIndexParser
public SimpleIndexParser()
parse
public java.util.Map<java.lang.String,RemotePackageInfo> parse(java.io.InputStream indexStream,
UrlProvider contentSource)
throws java.lang.Exception
- Description copied from interface:
IndexParser
- Given an input stream containing the index data, this will parse that data and return
the parsed information.
- Specified by:
parse in interface IndexParser
- Parameters:
indexStream - stream containing the index data (it is not necessary for this method to close this)contentSource - the content source where the index file came from
- Returns:
- map containing the package metadata info, keyed on each package's location
- Throws:
java.lang.Exception - if failed to parse the index file
main
public static void main(java.lang.String[] args)
- A utility that can build an index file that contains metadata for content found
in a given directory.
- Parameters:
args - directory where the content is found and where the content-index.txt file will be written
generatePackageIndex
protected static void generatePackageIndex(java.io.File file,
java.io.PrintWriter indexWriter,
java.io.File root)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.