org.apache.directory.shared.ldap.ldif
Class LdifIterator

java.lang.Object
  extended byorg.apache.directory.shared.ldap.ldif.LdifIterator
All Implemented Interfaces:
java.util.Iterator

public class LdifIterator
extends java.lang.Object
implements java.util.Iterator

Iterates through a set of LDIF's on a input channel.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Constructor Summary
LdifIterator(java.io.InputStream in)
          Creates a new LdifIterator object on a stream.
LdifIterator(java.io.InputStream in, LdifIteratorMonitor monitor)
          Creates a new LdifIterator object with a monitor on a stream.
LdifIterator(java.io.Reader in)
          Creates a new LdifIterator object on a reader.
LdifIterator(java.io.Reader in, LdifIteratorMonitor monitor)
          Creates a new LdifIterator object with a monitor on a reader.
 
Method Summary
static java.lang.String filterComment(java.lang.String line)
          Removes comments from a line as a filter before processing the lines.
 boolean hasNext()
          Tests to see if another LDIF is on the input channel.
 java.lang.Object next()
          Gets the next LDIF on the channel.
 void remove()
          Always throws UnsupportedOperationException!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdifIterator

public LdifIterator(java.io.InputStream in)
             throws java.io.IOException
Creates a new LdifIterator object on a stream.

Parameters:
in - the input stream to read from
Throws:
java.io.IOException - if we cannot wrap the stream with a reader

LdifIterator

public LdifIterator(java.io.Reader in)
             throws java.io.IOException
Creates a new LdifIterator object on a reader.

Parameters:
in - the reader to read from
Throws:
java.io.IOException - if we cannot wrap the reader with a bufferd reader

LdifIterator

public LdifIterator(java.io.InputStream in,
                    LdifIteratorMonitor monitor)
             throws java.io.IOException
Creates a new LdifIterator object with a monitor on a stream.

Parameters:
in - the input stream to read from
monitor - monitor to log to
Throws:
java.io.IOException - if we cannot wrap the stream with a reader

LdifIterator

public LdifIterator(java.io.Reader in,
                    LdifIteratorMonitor monitor)
             throws java.io.IOException
Creates a new LdifIterator object with a monitor on a reader.

Parameters:
monitor - monitor to log to
in - the reader to read from
Throws:
java.io.IOException - if we cannot wrap the reader with a bufferd reader
Method Detail

hasNext

public boolean hasNext()
Tests to see if another LDIF is on the input channel.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if another LDIF is available false otherwise.

next

public java.lang.Object next()
Gets the next LDIF on the channel.

Specified by:
next in interface java.util.Iterator
Returns:
the next LDIF as a String.

remove

public void remove()
Always throws UnsupportedOperationException!

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()

filterComment

public static java.lang.String filterComment(java.lang.String line)
Removes comments from a line as a filter before processing the lines.

Parameters:
line - the line to filter comments out of
Returns:
the comment free line


Copyright © 2003-2006 . All Rights Reserved.