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

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

public class HttpReader
extends Object

The http reader is a yum repo reader used to read metadata and bits from an existing (remote) yum repo using yum's native http interface.

Author:
jortel

Constructor Summary
HttpReader(String baseurl)
          Constructor.
 
Method Summary
 InputStream openStream(String suffix)
          Open an input stream to specifed relative url.
 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

HttpReader

public HttpReader(String baseurl)
Constructor.

Parameters:
basepath - The base url of a yum repo.
Method Detail

validate

public void validate()
              throws Exception
Validate the reader. Validates that the base url is valid.

Throws:
Exception - When baseurl is not valid.

openStream

public InputStream openStream(String suffix)
                       throws IOException
Open an input stream to specifed relative url. Prepends the baseurl to the url and opens and opens and input stream. Files with a .gz suffix will be unziped (inline).

Parameters:
suffix - A url that is relative to the baseurl and references 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.