org.rhq.common.drift
Interface ChangeSetReader

All Superinterfaces:
Iterable<FileEntry>
All Known Implementing Classes:
ChangeSetReaderImpl

public interface ChangeSetReader
extends Iterable<FileEntry>

Reads change set file in a sequential fashion. Note that class extends Iterable which means you can iterate over change set files as follows:

     ChangeSetReader reader = ...
     for (FileEntry entry : reader) {
         ...
     }
 


Method Summary
 void close()
          Closes the reader.
 Headers getHeaders()
          Returns the headers from change set file.
 FileEntry read()
          Read and return the next file entry or null if the end of the file has been reached.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getHeaders

Headers getHeaders()
                   throws ChangeSetReaderException
Returns the headers from change set file. This method can be called multiple times. Given a properly formatted change set file, this method should never return null.

Returns:
The change set headers
Throws:
ChangeSetReaderException - If an error occurs reading the file or the headers are not formatted correctly.

read

FileEntry read()
               throws ChangeSetReaderException
Read and return the next file entry or null if the end of the file has been reached.

Returns:
The next file entry
Throws:
ChangeSetReaderException - if an IO error occurs or if the file entry is not properly formatted.

close

void close()
           throws ChangeSetReaderException
Closes the reader.

Throws:
ChangeSetReaderException - if an IO error occurs


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