Skip to content

Commit b1d167f

Browse files
author
Gary Gregory
committed
Document using a try-with-resources, remove reference to deprecated
method.
1 parent c9d5443 commit b1d167f

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,9 +2023,8 @@ public static LineIterator lineIterator(final File file) throws IOException {
20232023
* <p>
20242024
* This method opens an {@code InputStream} for the file.
20252025
* When you have finished with the iterator you should close the stream
2026-
* to free internal resources. This can be done by calling the
2027-
* {@link LineIterator#close()} or
2028-
* {@link LineIterator#closeQuietly(LineIterator)} method.
2026+
* to free internal resources. This can be done by using a try-with-resources block or calling the
2027+
* {@link LineIterator#close()} method.
20292028
* </p>
20302029
* <p>
20312030
* The recommended usage pattern is:

src/main/java/org/apache/commons/io/IOUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,8 +1574,8 @@ public static int length(final Object[] array) {
15741574
* {@code LineIterator} holds a reference to the open
15751575
* {@code InputStream} specified here. When you have finished with
15761576
* the iterator you should close the stream to free internal resources.
1577-
* This can be done by closing the stream directly, or by calling
1578-
* {@link LineIterator#close()} or {@link LineIterator#closeQuietly(LineIterator)}.
1577+
* This can be done by using a try-with-resources block, closing the stream directly, or by calling
1578+
* {@link LineIterator#close()}.
15791579
* <p>
15801580
* The recommended usage pattern is:
15811581
* <pre>
@@ -1607,8 +1607,8 @@ public static LineIterator lineIterator(final InputStream input, final Charset c
16071607
* {@code LineIterator} holds a reference to the open
16081608
* {@code InputStream} specified here. When you have finished with
16091609
* the iterator you should close the stream to free internal resources.
1610-
* This can be done by closing the stream directly, or by calling
1611-
* {@link LineIterator#close()} or {@link LineIterator#closeQuietly(LineIterator)}.
1610+
* This can be done by using a try-with-resources block, closing the stream directly, or by calling
1611+
* {@link LineIterator#close()}.
16121612
* <p>
16131613
* The recommended usage pattern is:
16141614
* <pre>
@@ -1642,8 +1642,8 @@ public static LineIterator lineIterator(final InputStream input, final String ch
16421642
* {@code LineIterator} holds a reference to the open
16431643
* {@code Reader} specified here. When you have finished with the
16441644
* iterator you should close the reader to free internal resources.
1645-
* This can be done by closing the reader directly, or by calling
1646-
* {@link LineIterator#close()} or {@link LineIterator#closeQuietly(LineIterator)}.
1645+
* This can be done by using a try-with-resources block, closing the reader directly, or by calling
1646+
* {@link LineIterator#close()}.
16471647
* <p>
16481648
* The recommended usage pattern is:
16491649
* <pre>

0 commit comments

Comments
 (0)