This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push: new 15b2ac6c Javadoc 15b2ac6c is described below commit 15b2ac6c6e84782e55d99208d5112a4a890c5d1d Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jan 27 18:22:29 2024 -0500 Javadoc --- .../apache/commons/io/build/AbstractStreamBuilder.java | 18 +++++++++--------- .../apache/commons/io/input/AutoCloseInputStream.java | 11 ++++++++--- .../org/apache/commons/io/input/BOMInputStream.java | 9 +++++---- .../apache/commons/io/input/BoundedInputStream.java | 12 ++++++++++++ .../io/input/BufferedFileChannelInputStream.java | 15 +++++++-------- .../apache/commons/io/input/ChecksumInputStream.java | 10 ++++------ .../commons/io/input/MemoryMappedFileInputStream.java | 15 +++++++-------- .../io/input/MessageDigestCalculatingInputStream.java | 11 +++++------ .../commons/io/input/MessageDigestInputStream.java | 11 +++++------ .../commons/io/input/RandomAccessFileInputStream.java | 4 +++- .../apache/commons/io/input/ReadAheadInputStream.java | 10 ++++++---- .../commons/io/input/ReversedLinesFileReader.java | 16 ++++++++-------- .../apache/commons/io/input/ThrottledInputStream.java | 12 ++++++++++++ .../io/input/UnsynchronizedBufferedInputStream.java | 11 +++++++---- .../io/input/UnsynchronizedFilterInputStream.java | 9 +++++---- .../org/apache/commons/io/input/XmlStreamReader.java | 12 ++++++------ 16 files changed, 109 insertions(+), 77 deletions(-) diff --git a/src/main/java/org/apache/commons/io/build/AbstractStreamBuilder.java b/src/main/java/org/apache/commons/io/build/AbstractStreamBuilder.java index e0f9ba66..4262c690 100644 --- a/src/main/java/org/apache/commons/io/build/AbstractStreamBuilder.java +++ b/src/main/java/org/apache/commons/io/build/AbstractStreamBuilder.java @@ -112,9 +112,9 @@ public abstract class AbstractStreamBuilder<T, B extends AbstractStreamBuilder<T * Gets a CharSequence from the origin with a Charset. * * @return An input stream - * @throws IOException if an I/O error occurs. - * @throws UnsupportedOperationException if the origin cannot be converted to a CharSequence. * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a CharSequence. + * @throws IOException if an I/O error occurs. * @see AbstractOrigin#getCharSequence(Charset) * @since 2.13.0 */ @@ -144,10 +144,10 @@ public abstract class AbstractStreamBuilder<T, B extends AbstractStreamBuilder<T * Gets an input stream from the origin with open options. * * @return An input stream + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. * @throws IOException if an I/O error occurs. - * @throws UnsupportedOperationException if the origin cannot be converted to an InputStream. * @see AbstractOrigin#getInputStream(OpenOption...) - * @throws IllegalStateException if the {@code origin} is {@code null}. * @since 2.13.0 */ protected InputStream getInputStream() throws IOException { @@ -167,9 +167,9 @@ public abstract class AbstractStreamBuilder<T, B extends AbstractStreamBuilder<T * Gets an OutputStream from the origin with open options. * * @return An OutputStream - * @throws IOException if an I/O error occurs. - * @throws UnsupportedOperationException if the origin cannot be converted to an OutputStream. * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link OutputStream}. + * @throws IOException if an I/O error occurs. * @see AbstractOrigin#getOutputStream(OpenOption...) * @since 2.13.0 */ @@ -181,8 +181,8 @@ public abstract class AbstractStreamBuilder<T, B extends AbstractStreamBuilder<T * Gets a Path from the origin. * * @return A Path - * @throws UnsupportedOperationException if the origin cannot be converted to a Path. * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}. * @see AbstractOrigin#getPath() * @since 2.13.0 */ @@ -194,9 +194,9 @@ public abstract class AbstractStreamBuilder<T, B extends AbstractStreamBuilder<T * Gets an writer from the origin with open options. * * @return An writer. - * @throws IOException if an I/O error occurs. - * @throws UnsupportedOperationException if the origin cannot be converted to a Writer. * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link Writer}. + * @throws IOException if an I/O error occurs. * @see AbstractOrigin#getOutputStream(OpenOption...) * @since 2.13.0 */ diff --git a/src/main/java/org/apache/commons/io/input/AutoCloseInputStream.java b/src/main/java/org/apache/commons/io/input/AutoCloseInputStream.java index 7a6089d0..816bbf3a 100644 --- a/src/main/java/org/apache/commons/io/input/AutoCloseInputStream.java +++ b/src/main/java/org/apache/commons/io/input/AutoCloseInputStream.java @@ -65,12 +65,17 @@ public class AutoCloseInputStream extends ProxyInputStream { /** * Constructs a new instance. * <p> - * This builder use the aspect InputStream. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. + * </p> + * <p> + * This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[]. * </p> * * @return a new instance. - * @throws IOException if an I/O error occurs. - * @throws IllegalArgumentException if the buffer is not large enough to hold a complete character. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. + * @see #getInputStream() */ @SuppressWarnings("resource") // Caller closes @Override diff --git a/src/main/java/org/apache/commons/io/input/BOMInputStream.java b/src/main/java/org/apache/commons/io/input/BOMInputStream.java index 3a2aed52..ad723f7b 100644 --- a/src/main/java/org/apache/commons/io/input/BOMInputStream.java +++ b/src/main/java/org/apache/commons/io/input/BOMInputStream.java @@ -138,15 +138,16 @@ public class BOMInputStream extends ProxyInputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[]. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[]. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() */ @SuppressWarnings("resource") diff --git a/src/main/java/org/apache/commons/io/input/BoundedInputStream.java b/src/main/java/org/apache/commons/io/input/BoundedInputStream.java index f3d7e6f1..f6f4373f 100644 --- a/src/main/java/org/apache/commons/io/input/BoundedInputStream.java +++ b/src/main/java/org/apache/commons/io/input/BoundedInputStream.java @@ -65,6 +65,18 @@ public class BoundedInputStream extends ProxyInputStream { /** Flag if close should be propagated. */ private boolean propagateClose = true; + /** + * Constructs a new instance. + * <p> + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. + * </p> + * + * @return a new instance. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. + * @see #getInputStream() + */ @SuppressWarnings("resource") @Override public BoundedInputStream get() throws IOException { diff --git a/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java b/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java index 182090da..045ab068 100644 --- a/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java +++ b/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java @@ -25,7 +25,6 @@ import java.nio.file.StandardOpenOption; import java.util.Objects; import org.apache.commons.io.IOUtils; -import org.apache.commons.io.build.AbstractOrigin; import org.apache.commons.io.build.AbstractStreamBuilder; /** @@ -73,16 +72,16 @@ public final class BufferedFileChannelInputStream extends InputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects Path and buffer size. - * </p> - * <p> - * You must provide an origin that can be converted to a Path by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getPath()} and {@link #getBufferSize()} on this builder, otherwise, this method throws an + * exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide a Path. - * @see AbstractOrigin#getPath() + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}. + * @throws IOException If an I/O error occurs + * @see #getPath() + * @see #getBufferSize() */ @Override public BufferedFileChannelInputStream get() throws IOException { diff --git a/src/main/java/org/apache/commons/io/input/ChecksumInputStream.java b/src/main/java/org/apache/commons/io/input/ChecksumInputStream.java index f1a25517..b3a052e6 100644 --- a/src/main/java/org/apache/commons/io/input/ChecksumInputStream.java +++ b/src/main/java/org/apache/commons/io/input/ChecksumInputStream.java @@ -118,15 +118,13 @@ public final class ChecksumInputStream extends CountingInputStream { /** * Constructs a new instance. * <p> - * This builder requires an input convertible by {@link #getInputStream()}. - * </p> - * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will - * throw an {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() */ @SuppressWarnings("resource") diff --git a/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java b/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java index 3d03f8ce..c60af531 100644 --- a/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java +++ b/src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java @@ -27,7 +27,6 @@ import java.nio.channels.FileChannel.MapMode; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import org.apache.commons.io.build.AbstractOrigin; import org.apache.commons.io.build.AbstractStreamBuilder; /** @@ -98,16 +97,16 @@ public final class MemoryMappedFileInputStream extends InputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects Path and buffer size. - * </p> - * <p> - * You must provide an origin that can be converted to a Path by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getPath()} and {@link #getBufferSize()} this builder, otherwise, this method throws an + * exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide a Path. - * @see AbstractOrigin#getPath() + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}. + * @throws IOException if an I/O error occurs. + * @see #getPath() + * @see #getBufferSize() */ @Override public MemoryMappedFileInputStream get() throws IOException { diff --git a/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java b/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java index 97d7ff59..c3ffc1b4 100644 --- a/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java +++ b/src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java @@ -76,15 +76,14 @@ public class MessageDigestCalculatingInputStream extends ObservableInputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects InputStream, OpenOption[], and MessageDigest. - * </p> - * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws NullPointerException if messageDigest is null. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() */ @SuppressWarnings("resource") diff --git a/src/main/java/org/apache/commons/io/input/MessageDigestInputStream.java b/src/main/java/org/apache/commons/io/input/MessageDigestInputStream.java index d822256b..a465ad72 100644 --- a/src/main/java/org/apache/commons/io/input/MessageDigestInputStream.java +++ b/src/main/java/org/apache/commons/io/input/MessageDigestInputStream.java @@ -74,15 +74,14 @@ public final class MessageDigestInputStream extends ObservableInputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects InputStream, OpenOption[], and MessageDigest. - * </p> - * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws NullPointerException if messageDigest is null. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() */ @SuppressWarnings("resource") diff --git a/src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java b/src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java index 07a8a979..25e20c23 100644 --- a/src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java +++ b/src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java @@ -17,6 +17,7 @@ package org.apache.commons.io.input; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile; @@ -66,8 +67,9 @@ public class RandomAccessFileInputStream extends InputStream { * </p> * * @return a new instance. + * @throws IllegalStateException if the {@code origin} is {@code null}. * @throws IllegalStateException if both RandomAccessFile and origin are set. - * @throws UnsupportedOperationException if the origin cannot provide a File. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link File}. * @see AbstractOrigin#getFile() */ @SuppressWarnings("resource") // Caller closes depending on settings diff --git a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java index dc4fc08d..efafbb16 100644 --- a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java +++ b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java @@ -69,16 +69,18 @@ public class ReadAheadInputStream extends FilterInputStream { /** * Constructs a new instance. * <p> - * This builder use the aspects InputStream, OpenOption[], buffer size, ExecutorService. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * This builder use the aspects InputStream, OpenOption[], buffer size, ExecutorService. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() + * @see #getBufferSize() */ @SuppressWarnings("resource") @Override diff --git a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java index f8056904..0e118115 100644 --- a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java +++ b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java @@ -36,7 +36,6 @@ import java.util.List; import org.apache.commons.io.Charsets; import org.apache.commons.io.FileSystem; import org.apache.commons.io.StandardLineSeparator; -import org.apache.commons.io.build.AbstractOrigin; import org.apache.commons.io.build.AbstractStreamBuilder; /** @@ -77,16 +76,17 @@ public class ReversedLinesFileReader implements Closeable { /** * Constructs a new instance. * <p> - * This builder use the aspects Path, Charset, buffer size. - * </p> - * <p> - * You must provide an origin that can be converted to a Path by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * You must provide an origin that supports calling {@link #getInputStream()}, {@link #getBufferSize()}, and {@link #getCharset()} on this builder, + * otherwise, this method throws an exception. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide a Path. - * @see AbstractOrigin#getPath() + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}. + * @throws IOException if an I/O error occurs. + * @see #getPath() + * @see #getBufferSize() + * @see #getCharset() */ @Override public ReversedLinesFileReader get() throws IOException { diff --git a/src/main/java/org/apache/commons/io/input/ThrottledInputStream.java b/src/main/java/org/apache/commons/io/input/ThrottledInputStream.java index b6b464ec..ec5c37c0 100644 --- a/src/main/java/org/apache/commons/io/input/ThrottledInputStream.java +++ b/src/main/java/org/apache/commons/io/input/ThrottledInputStream.java @@ -67,6 +67,18 @@ public final class ThrottledInputStream extends CountingInputStream { */ private long maxBytesPerSecond = Long.MAX_VALUE; + /** + * Constructs a new instance. + * <p> + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. + * </p> + * + * @return a new instance. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. + * @see #getInputStream() + */ @SuppressWarnings("resource") @Override public ThrottledInputStream get() throws IOException { diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java index f3e0dc0f..3cf17d3d 100644 --- a/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java +++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java @@ -80,16 +80,19 @@ public final class UnsynchronizedBufferedInputStream extends UnsynchronizedFilte /** * Constructs a new instance. * <p> - * This builder use the aspects InputStream, OpenOption[] and buffer size. + * You must provide an origin that supports calling {@link #getInputStream()} and {@link #getBufferSize()} on this builder, otherwise, this method + * throws an exception. * </p> * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * This builder use the aspects InputStream, OpenOption[] and buffer size. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() + * @see #getBufferSize() */ @SuppressWarnings("resource") // Caller closes. @Override diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java index d5ae16a1..f2f02949 100644 --- a/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java +++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java @@ -67,15 +67,16 @@ public class UnsynchronizedFilterInputStream extends InputStream { /** * Constructs a new instance. * <p> - * This builder use the aspect InputStream and OpenOption[]. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * This builder use the aspects InputStream, OpenOption[] and buffer size. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. * @see #getInputStream() */ @SuppressWarnings("resource") // Caller closes. diff --git a/src/main/java/org/apache/commons/io/input/XmlStreamReader.java b/src/main/java/org/apache/commons/io/input/XmlStreamReader.java index e2067890..b4707795 100644 --- a/src/main/java/org/apache/commons/io/input/XmlStreamReader.java +++ b/src/main/java/org/apache/commons/io/input/XmlStreamReader.java @@ -119,17 +119,17 @@ public class XmlStreamReader extends Reader { /** * Constructs a new instance. * <p> - * This builder use the aspect InputStream, OpenOption[], httpContentType, lenient, and defaultEncoding. + * You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception. * </p> * <p> - * You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an - * {@link UnsupportedOperationException}. + * This builder use the aspect InputStream, OpenOption[], httpContentType, lenient, and defaultEncoding. * </p> * * @return a new instance. - * @throws UnsupportedOperationException if the origin cannot provide an InputStream. - * @throws IOException thrown if there is a problem reading the stream. - * @throws XmlStreamReaderException thrown if the charset encoding could not be determined according to the specification. + * @throws IllegalStateException if the {@code origin} is {@code null}. + * @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}. + * @throws IOException if an I/O error occurs. + * @throws XmlStreamReaderException thrown if the Charset encoding could not be determined according to the specification. * @see #getInputStream() */ @SuppressWarnings("resource")