org.rhq.enterprise.server.plugins.yum
Class DiskReader

java.lang.Object
  extended by org.rhq.enterprise.server.plugins.yum.DiskReader

public class DiskReader
extends Object

The disk reader is a yum repo reader used to read metadata and bits from an existing yum repo that is located on a filesystem.

Author:
jortel

Constructor Summary
DiskReader(String basepath)
          Constructor.
 
Method Summary
 InputStream openStream(String path)
          Open an input stream to specifed relative path.
 String toString()
           
 void validate()
          Validate the reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiskReader

public DiskReader(String basepath)
Constructor.

Parameters:
basepath - The base or root directory path of a yum repo.
Method Detail

validate

public void validate()
              throws Exception
Validate the reader. Validates that the base path is an existing directory that is readable.

Throws:
Exception - When basepath is not a directory, does not exist, or is not readable.

openStream

public InputStream openStream(String path)
                       throws IOException
Open an input stream to specifed relative path. Prepends the basepath to the path and opens and opens and input stream.

Parameters:
path - A relative path to a file within the repo.
Returns:
An open input stream that must be closed by the caller.
Throws:
IOException - On all errors.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.