@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class DNFileReader extends java.lang.Object implements java.io.Closeable
Constructor and Description |
---|
DNFileReader(java.io.File dnFile)
Creates a new DN file reader that will read from the specified file.
|
DNFileReader(java.lang.String path)
Creates a new DN file reader that will read from the file with the
specified path.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this DN file reader.
|
DN |
readDN()
Reads the next DN from the file.
|
public DNFileReader(@NotNull java.lang.String path) throws java.io.IOException
path
- The path to the file to be read. It must not be null
and the file must exist.java.io.IOException
- If a problem is encountered while opening the file
for reading.public DNFileReader(@NotNull java.io.File dnFile) throws java.io.IOException
dnFile
- The file to be read. It must not be null
and the
file must exist.java.io.IOException
- If a problem is encountered while opening the file
for reading.@Nullable public DN readDN() throws java.io.IOException, LDAPException
null
if there are no more
DNs to be read.java.io.IOException
- If a problem is encountered while trying to read from
the file.LDAPException
- If data read from the file can't be parsed as a DN.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- If a problem is encountered while closing the reader.