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 af17dc6ce Javadoc
af17dc6ce is described below
commit af17dc6ce77d47ab57ad484f5d936004a5bf24a2
Author: Gary D. Gregory <[email protected]>
AuthorDate: Thu Oct 23 08:52:17 2025 -0400
Javadoc
---
.../apache/commons/io/build/AbstractOrigin.java | 23 ++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
b/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
index d84aefdb7..d8edc15ea 100644
--- a/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
+++ b/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
@@ -366,6 +366,7 @@ public abstract static class
AbstractRandomAccessFileOrigin<T extends RandomAcce
* </p>
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public AbstractRandomAccessFileOrigin(final T origin) {
super(origin);
@@ -437,6 +438,7 @@ public static class ByteArrayOrigin extends
AbstractOrigin<byte[], ByteArrayOrig
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public ByteArrayOrigin(final byte[] origin) {
super(origin);
@@ -499,6 +501,7 @@ public static class ChannelOrigin extends
AbstractOrigin<Channel, ChannelOrigin>
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public ChannelOrigin(final Channel origin) {
super(origin);
@@ -563,6 +566,7 @@ public static class CharSequenceOrigin extends
AbstractOrigin<CharSequence, Char
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public CharSequenceOrigin(final CharSequence origin) {
super(origin);
@@ -641,6 +645,7 @@ public static class FileOrigin extends AbstractOrigin<File,
FileOrigin> {
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public FileOrigin(final File origin) {
super(origin);
@@ -689,6 +694,7 @@ public static class InputStreamOrigin extends
AbstractOrigin<InputStream, InputS
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public InputStreamOrigin(final InputStream origin) {
super(origin);
@@ -774,6 +780,7 @@ public static class OutputStreamOrigin extends
AbstractOrigin<OutputStream, Outp
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public OutputStreamOrigin(final OutputStream origin) {
super(origin);
@@ -823,6 +830,7 @@ public static class PathOrigin extends AbstractOrigin<Path,
PathOrigin> {
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public PathOrigin(final Path origin) {
super(origin);
@@ -892,6 +900,7 @@ public static class ReaderOrigin extends
AbstractOrigin<Reader, ReaderOrigin> {
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public ReaderOrigin(final Reader origin) {
super(origin);
@@ -959,6 +968,7 @@ public static class URIOrigin extends AbstractOrigin<URI,
URIOrigin> {
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public URIOrigin(final URI origin) {
super(origin);
@@ -1007,6 +1017,7 @@ public static class WriterOrigin extends
AbstractOrigin<Writer, WriterOrigin> {
* Constructs a new instance for the given origin.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
public WriterOrigin(final Writer origin) {
super(origin);
@@ -1057,15 +1068,16 @@ public Writer getWriter(final Charset charset, final
OpenOption... options) thro
* Constructs a new instance for subclasses.
*
* @param origin The origin, not null.
+ * @throws NullPointerException if {@code origin} is {@code null}.
*/
protected AbstractOrigin(final T origin) {
this.origin = Objects.requireNonNull(origin, "origin");
}
/**
- * Gets the origin.
+ * Gets the origin, never null.
*
- * @return the origin.
+ * @return the origin, never null.
*/
@Override
public T get() {
@@ -1113,6 +1125,7 @@ public byte[] getByteArray(final long position, final int
length) throws IOExcep
* @param <C> The type of channel to return.
* @throws IOException If an I/O error occurs.
* @throws UnsupportedOperationException If this origin cannot be
converted to a channel of the given type.
+ * @see #getChannel(OpenOption...)
* @since 2.21.0
*/
public final <C extends Channel> C getChannel(final Class<C> channelType,
final OpenOption... options) throws IOException {
@@ -1131,6 +1144,7 @@ public final <C extends Channel> C getChannel(final
Class<C> channelType, final
* @return A new Channel on the origin.
* @throws IOException If an I/O error occurs.
* @throws UnsupportedOperationException If this origin cannot be
converted to a channel.
+ * @see #getChannel(Class, OpenOption...)
* @since 2.21.0
*/
protected Channel getChannel(final OpenOption... options) throws
IOException {
@@ -1217,6 +1231,11 @@ public Reader getReader(final Charset charset) throws
IOException {
return Files.newBufferedReader(getPath(), Charsets.toCharset(charset));
}
+ /**
+ * Gets simple name of the underlying class.
+ *
+ * @return The simple name of the underlying class.
+ */
private String getSimpleClassName() {
return getClass().getSimpleName();
}