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
commit d2ce428861721beef0d37a1c6ec1b42b9d319496 Author: Gary Gregory <[email protected]> AuthorDate: Thu May 18 10:15:44 2023 -0400 [IO-793] Add StringInputStream. - StringInputStream.java should be in main source folder. - Bump version from 2.12.1-SNAPSHOT to 2.13.0-SNAPSHOT --- pom.xml | 10 +++++----- src/changes/changes.xml | 11 ++++++----- .../apache/commons/io/input/StringInputStream.java | 20 +++++++++++++++----- src/site/xdoc/index.xml | 15 ++++++++++++++- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 1e0da215..1feee5e7 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.12.1-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <name>Apache Commons IO</name> <inceptionYear>2002</inceptionYear> @@ -52,7 +52,7 @@ file comparators, endian transformation classes, and much more. <connection>scm:git:https://gitbox.apache.org/repos/asf/commons-io.git</connection> <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-io.git</developerConnection> <url>https://gitbox.apache.org/repos/asf?p=commons-io.git</url> - <tag>rel/commons-io-2.12.0</tag> + <tag>rel/commons-io-2.13.0</tag> </scm> <developers> @@ -293,9 +293,9 @@ file comparators, endian transformation classes, and much more. <maven.compiler.target>1.8</maven.compiler.target> <commons.componentid>io</commons.componentid> <commons.module.name>org.apache.commons.io</commons.module.name> - <commons.rc.version>RC2</commons.rc.version> - <commons.bc.version>2.11.0</commons.bc.version> - <commons.release.version>2.12.0</commons.release.version> + <commons.rc.version>RC1</commons.rc.version> + <commons.bc.version>2.12.0</commons.bc.version> + <commons.release.version>2.13.0</commons.release.version> <commons.release.desc>(requires Java 8)</commons.release.desc> <commons.jira.id>IO</commons.jira.id> <commons.jira.pid>12310477</commons.jira.pid> diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 521613c6..5024e279 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -47,10 +47,14 @@ The <action> type attribute can be add,update,fix,remove. </properties> <body> - <release version="2.12.1" date="2023-MM-DD" description="Java 8 required."> + <release version="2.13.0" date="2023-MM-DD" description="Java 8 required."> <!-- FIX --> <action issue="IO-791" dev="ggregory" type="fix" due-to="Chad Wilson, Gary Gregory"> - Regression in FileUtils.touch - no longer creates parent directories. + Regression in FileUtils.touch() - no longer creates parent directories. + </action> + <!-- ADD --> + <action issue="IO-793" dev="ggregory" type="add" due-to="Gary Gregory, K P"> + Add StringInputStream. StringInputStream.java should be in main source folder. </action> </release> <release version="2.12.0" date="2023-05-13" description="Java 8 required."> @@ -255,9 +259,6 @@ The <action> type attribute can be add,update,fix,remove. <action dev="ggregory" type="add" due-to="Gary Gregory"> Add UncheckedFilterWriter. </action> - <action dev="ggregory" type="add" due-to="Gary Gregory"> - Add StringInputStream. - </action> <action dev="ggregory" type="add" due-to="Gary Gregory"> Add UncheckedFilterInputStream. </action> diff --git a/src/test/java/org/apache/commons/io/input/StringInputStream.java b/src/main/java/org/apache/commons/io/input/StringInputStream.java similarity index 78% rename from src/test/java/org/apache/commons/io/input/StringInputStream.java rename to src/main/java/org/apache/commons/io/input/StringInputStream.java index d4a5e1bd..f3cdceca 100644 --- a/src/test/java/org/apache/commons/io/input/StringInputStream.java +++ b/src/main/java/org/apache/commons/io/input/StringInputStream.java @@ -20,6 +20,7 @@ package org.apache.commons.io.input; import java.io.InputStream; import java.io.StringReader; import java.nio.charset.Charset; +import java.util.Objects; import org.apache.commons.io.build.AbstractStreamBuilder; @@ -28,13 +29,14 @@ import org.apache.commons.io.build.AbstractStreamBuilder; * * @since 2.13.0 */ -public class StringInputStream extends ReaderInputStream { +public final class StringInputStream extends ReaderInputStream { /** * Builds a new {@link StringInputStream} instance. * <p> * For example: * </p> + * * <pre>{@code * ReaderInputStream s = new StringInputStream.Builder() * .setString("String") @@ -57,18 +59,26 @@ public class StringInputStream extends ReaderInputStream { return new StringInputStream(string, getCharset()); } - public Builder setString(final String string) { - this.string = string; + /** + * Sets the non-null string. + * + * @param source The source string, MUST not be null. + * @return this. + */ + public Builder setString(final String source) { + this.string = Objects.requireNonNull(source, "source"); return this; } } + /** * Creates a new instance on a String for a Charset. * - * @param source The source string, MUST not be null. - * @param charset The source charset, MUST not be null. + * @param source The source string, MUST not be null. + * @param charset The source charset, null defaults to {@link Charset#defaultCharset()}. */ + @SuppressWarnings("deprecation") private StringInputStream(final String source, final Charset charset) { super(new StringReader(source), charset); } diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml index 3733b191..1d311b0c 100644 --- a/src/site/xdoc/index.xml +++ b/src/site/xdoc/index.xml @@ -85,6 +85,19 @@ There are six main areas included: <!-- ================================================== --> <section name="Releases"> + <subsection name="Commons IO 2.13.0 (requires Java 8)"> + <p> + Commons IO 2.13.0 requires a minimum of Java 8 - + <a href="https://commons.apache.org/io/download_io.cgi">Download now!</a> + </p> + <p> + View the + <a href="changes-report.html">Release Notes</a> + and + <a href="apidocs/index.html">Javadoc API documents</a> + </p> + </subsection> + <subsection name="Commons IO 2.12.0 (requires Java 8)"> <p> Commons IO 2.12.0 requires a minimum of Java 8 - @@ -94,7 +107,7 @@ There are six main areas included: View the <a href="changes-report.html">Release Notes</a> and - <a href="apidocs/index.html">Javadoc API documents</a> + <a href="https://javadoc.io/doc/commons-io/commons-io/2.12.0/index.html">Javadoc API documents</a> </p> </subsection>
