8000 Javadoc · apache/commons-io@15b2ac6 · GitHub
Skip to content

Commit 15b2ac6

Browse files
committed
Javadoc
1 parent 6dbf497 commit 15b2ac6

16 files changed

Lines changed: 109 additions & 77 deletions

src/main/java/org/apache/commons/io/build/AbstractStreamBuilder.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ protected int getBufferSizeDefault() {
112112
* Gets a CharSequence from the origin with a Charset.
113113
*
114114
* @return An input stream
115-
* @throws IOException if an I/O error occurs.
116-
* @throws UnsupportedOperationException if the origin cannot be converted to a CharSequence.
117115
10000 * @throws IllegalStateException if the {@code origin} is {@code null}.
116+
* @throws UnsupportedOperationException if the origin cannot be converted to a CharSequence.
117+
* @throws IOException if an I/O error occurs.
118118
* @see AbstractOrigin#getCharSequence(Charset)
119119
* @since 2.13.0
120120
*/
@@ -144,10 +144,10 @@ protected Charset getCharsetDefault() {
144144
* Gets an input stream from the origin with open options.
145145
*
146146
* @return An input stream
147+
* @throws IllegalStateException if the {@code origin} is {@code null}.
148+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
147149
* @throws IOException if an I/O error occurs.
148-
* @throws UnsupportedOperationException if the origin cannot be converted to an InputStream.
149150
* @see AbstractOrigin#getInputStream(OpenOption...)
150-
* @throws IllegalStateException if the {@code origin} is {@code null}.
151151
* @since 2.13.0
152152
*/
153153
protected InputStream getInputStream() throws IOException {
@@ -167,9 +167,9 @@ protected OpenOption[] getOpenOptions() {
167167
* Gets an OutputStream from the origin with open options.
168168
*
169169
* @return An OutputStream
170-
* @throws IOException if an I/O error occurs.
171-
* @throws UnsupportedOperationException if the origin cannot be converted to an OutputStream.
172170
* @throws IllegalStateException if the {@code origin} is {@code null}.
171+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link OutputStream}.
172+
* @throws IOException if an I/O error occurs.
173173
* @see AbstractOrigin#getOutputStream(OpenOption...)
174174
* @since 2.13.0
175175
*/
@@ -181,8 +181,8 @@ protected OutputStream getOutputStream() throws IOException {
181181
* Gets a Path from the origin.
182182
*
183183
* @return A Path
184-
* @throws UnsupportedOperationException if the origin cannot be converted to a Path.
185184
* @throws IllegalStateException if the {@code origin} is {@code null}.
185+
* @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}.
186186
* @see AbstractOrigin#getPath()
187187
* @since 2.13.0
188188
*/
@@ -194,9 +194,9 @@ protected Path getPath() {
194194
* Gets an writer from the origin with open options.
195195
*
196196
* @return An writer.
197-
* @throws IOException if an I/O error occurs.
198-
* @throws UnsupportedOperationException if the origin cannot be converted to a Writer.
199197
* @throws IllegalStateException if the {@code origin} is {@code null}.
198+
* @throws UnsupportedOperationException if the origin cannot be converted to a {@link Writer}.
199+
* @throws IOException if an I/O error occurs.
200200
* @see AbstractOrigin#getOutputStream(OpenOption...)
201201
* @since 2.13.0
202202
*/

src/main/java/org/apache/commons/io/input/AutoCloseInputStream.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,17 @@ public static class Builder extends AbstractStreamBuilder<AutoCloseInputStream,
6565
/**
6666
* Constructs a new instance.
6767
* <p>
68-
* This builder use the aspect InputStream.
68+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
69+
* </p>
70+
* <p>
71+
* This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[].
6972
* </p>
7073
*
7174
* @return a new instance.
72-
* @throws IOException if an I/O error occurs.
73-
* @throws IllegalArgumentException if the buffer is not large enough to hold a complete character.
75+
* @throws IllegalStateException if the {@code origin} is {@code null}.
76+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
77+
* @throws IOException if an I/O error occurs.
78+
* @see #getInputStream()
7479
*/
7580
@SuppressWarnings("resource") // Caller closes
7681
@Override

src/main/java/org/apache/commons/io/input/BOMInputStream.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,16 @@ static ByteOrderMark getDefaultByteOrderMark() {
138138
/**
139139
* Constructs a new instance.
140140
* <p>
141-
* This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[].
141+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
142142
* </p>
143143
* <p>
144-
* You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an
145-
* {@link UnsupportedOperationException}.
144+
* This builder use the aspects InputStream, OpenOption[], include, and ByteOrderMark[].
146145
* </p>
147146
*
148147
* @return a new instance.
149-
* @throws UnsupportedOperationException if the origin cannot provide an InputStream.
148+
* @throws IllegalStateException if the {@code origin} is {@code null}.
149+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
150+
* @throws IOException if an I/O error occurs.
150151
* @see #getInputStream()
151152
*/
152153
@SuppressWarnings("resource")

src/main/java/org/apache/commons/io/input/BoundedInputStream.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ public static class Builder extends AbstractStreamBuilder<BoundedInputStream, Bu
6565
/** Flag if close should be propagated. */
6666
private boolean propagateClose = true;
6767

68+
/**
69+
* Constructs a new instance.
70+
* <p>
71+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
72+
* </p>
73+
*
74+
* @return a new instance.
75+
* @throws IllegalStateException if the {@code origin} is {@code null}.
76+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
77+
* @throws IOException if an I/O error occurs.
78+
* @see #getInputStream()
79+
*/
6880
@SuppressWarnings("resource")
6981
@Override
7082
public BoundedInputStream get() throws IOException {

src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.Objects;
2626

2727
import org.apache.commons.io.IOUtils;
28-
import org.apache.commons.io.build.AbstractOrigin;
2928
import org.apache.commons.io.build.AbstractStreamBuilder;
3029

3130
/**
@@ -73,16 +72,16 @@ public static class Builder extends AbstractStreamBuilder<BufferedFileChannelInp
7372
/**
7473
* Constructs a new instance.
7574
* <p>
76-
* This builder use the aspects Path and buffer size.
77-
* </p>
78-
* <p>
79-
* You must provide an origin that can be converted to a Path by this builder, otherwise, this call will throw an
80-
* {@link UnsupportedOperationException}.
75+
* You must provide an origin that supports calling {@link #getPath()} and {@link #getBufferSize()} on this builder, otherwise, this method throws an
76+
* exception.
8177
* </p>
8278
*
8379
* @return a new instance.
84-
* @throws UnsupportedOperationException if the origin cannot provide a Path.
85-
* @see AbstractOrigin#getPath()
80+
* @throws IllegalStateException if the {@code origin} is {@code null}.
81+
* @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}.
82+
* @throws IOException If an I/O error occurs
83+
* @see #getPath()
84+
* @see #getBufferSize()
8685
*/
8786
@Override
8887
public BufferedFileChannelInputStream get() throws IOException {

src/main/java/org/apache/commons/io/input/ChecksumInputStream.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,13 @@ public static class Builder extends AbstractStreamBuilder<ChecksumInputStream, B
118118
/**
119119
* Constructs a new instance.
120120
* <p>
121-
* This builder requires an input convertible by {@link #getInputStream()}.
122-
* </p>
123-
* <p>
124-
* You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will
125-
* throw an {@link UnsupportedOperationException}.
121+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
126122
* </p>
127123
*
128124
* @return a new instance.
129-
* @throws UnsupportedOperationException if the origin cannot provide an InputStream.
125+
* @throws IllegalStateException if the {@code origin} is {@code null}.
126+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
127+
* @throws IOException if an I/O error occurs.
130128
* @see #getInputStream()
131129
*/
132130
@SuppressWarnings("resource")

src/main/java/org/apache/commons/io/input/MemoryMappedFileInputStream.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.nio.file.Path;
2828
import java.nio.file.StandardOpenOption;
2929

30-
import org.apache.commons.io.build.AbstractOrigin;
3130
import org.apache.commons.io.build.AbstractStreamBuilder;
3231

3332
/**
@@ -98,16 +97,16 @@ public Builder() {
9897
/**
9998
* Constructs a new instance.
10099
* <p>
101-
* This builder use the aspects Path and buffer size.
102-
* </p>
103-
* <p>
104-
* You must provide an origin that can be converted to a Path by this builder, otherwise, this call will throw an
105-
* {@link UnsupportedOperationException}.
100+
* You must provide an origin that supports calling {@link #getPath()} and {@link #getBufferSize()} this builder, otherwise, this method throws an
101+
* exception.
106102
* </p>
107103
*
108104
* @return a new instance.
109-
* @throws UnsupportedOperationException if the origin cannot provide a Path.
110-
* @see AbstractOrigin#getPath()
105+
* @throws IllegalStateException if the {@code origin} is {@code null}.
106+
* @throws UnsupportedOperationException if the origin cannot be converted to a {@link Path}.
107+
* @throws IOException if an I/O error occurs.
108+
* @see #getPath()
109+
* @see #getBufferSize()
111110
*/
112111
@Override
113112
public MemoryMappedFileInputStream get() throws IOException {

src/main/java/org/apache/commons/io/input/MessageDigestCalculatingInputStream.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,14 @@ public Builder() {
7676
/**
7777
* Constructs a new instance.
7878
* <p>
79-
* This builder use the aspects InputStream, OpenOption[], and MessageDigest.
80-
* </p>
81-
* <p>
82-
* You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an
83-
* {@link UnsupportedOperationException}.
79+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
8480
* </p>
8581
*
8682
* @return a new instance.
87-
* @throws UnsupportedOperationException if the origin cannot provide an InputStream.
83+
* @throws NullPointerException if messageDigest is null.
84+
* @throws IllegalStateException if the {@code origin} is {@code null}.
85+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
86+
* @throws IOException if an I/O error occurs.
8887
* @see #getInputStream()
8988
*/
9089
@SuppressWarnings("resource")

src/main/java/org/apache/commons/io/input/MessageDigestInputStream.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,14 @@ public Builder() {
7474
/**
7575
* Constructs a new instance.
7676
* <p>
77-
* This builder use the aspects InputStream, OpenOption[], and MessageDigest.
78-
* </p>
79-
* <p>
80-
* You must provide an origin that can be converted to an InputStream by this builder, otherwise, this call will throw an
81-
* {@link UnsupportedOperationException}.
77+
* You must provide an origin that supports calling {@link #getInputStream()} on this builder, otherwise, this method throws an exception.
8278
* </p>
8379
*
8480
* @return a new instance.
85-
* @throws UnsupportedOperationException if the origin cannot provide an InputStream.
81+
* @throws NullPointerException if messageDigest is null.
82+
* @throws IllegalStateException if the {@code origin} is {@code null}.
83+
* @throws UnsupportedOperationException if the origin cannot be converted to an {@link InputStream}.
84+
* @throws IOException if an I/O error occurs.
8685
* @see #getInputStream()
8786
*/
8887
@SuppressWarnings("resource")

src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.commons.io.input;
1919

20+
import java.io.File;
2021
import java.io.IOException;
2122
import java.io.InputStream;
2223
import java.io.RandomAccessFile;
@@ -66,8 +67,9 @@ public static class Builder extends AbstractStreamBuilder<RandomAccessFileInputS
6667
* </p>
6768
*
6869
* @return a new instance.
70+
* @throws IllegalStateException if the {@code origin} is {@code null}.
6971
* @throws IllegalStateException if both RandomAccessFile and origin are set.
70-
* @throws UnsupportedOperationException if the origin cannot provide a File.
72+
* @throws UnsupportedOperationException if the origin cannot be converted to a {@link File}.
7173
* @see AbstractOrigin#getFile()
7274
*/
7375
@SuppressWarnings("resource") // Caller closes depending on settings

0 commit comments

Comments
 (0)