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 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleIndexParser
public SimpleIndexParser()
parse
public Map<String,RemotePackageInfo> parse(InputStream indexStream,
UrlProvider contentSource)
throws 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:
Exception - if failed to parse the index file
main
public static void main(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(File file,
PrintWriter indexWriter,
File root)
throws Exception
- Throws:
Exception
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.