Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 24, 2023
1 parent c511d15 commit 72b1f88
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
5 changes: 4 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ The <action> type attribute can be add,update,fix,remove.
ReaderInputStream.read() throws an exception instead of returning -1 when called again after returning -1.
</action>
<action dev="ggregory" type="fix" issue="IO-804" due-to="Elliotte Rusty Harold, Gary Gregory">
FileUtils.forceMkdirParent() Javadoc is likely incorrect.
FileUtils.forceMkdirParent() Javadoc is incorrect.
</action>
<action dev="ggregory" type="fix" due-to="step-security-bot, Gary Gregory">
[StepSecurity] ci: Harden GitHub Actions #461.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
MagicNumberFileFilter.accept(Path, BasicFileAttributes) doesn't its byteOffset before reading.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
Javadoc improvements.
</action>
<!-- ADD -->
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add DeferredFileOutputStream.getPath().
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/apache/commons/io/input/XmlStreamReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public Builder setLenient(final boolean lenient) {

private static final String RAW_EX_2 = "Illegal encoding, BOM [{0}] XML guess [{1}] XML prolog [{2}] unknown BOM";

private static final String HTTP_EX_1 = "Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], BOM must be NULL";
private static final String HTTP_EX_1 = "Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], BOM must be null";

private static final String HTTP_EX_2 = "Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], encoding mismatch";

Expand All @@ -225,7 +225,7 @@ public static Builder builder() {
}

/**
* Gets the charset parameter value, NULL if not present, NULL if httpContentType is NULL.
* Gets the charset parameter value, {@code null} if not present, {@code null} if httpContentType is {@code null}.
*
* @param httpContentType the HTTP content type
* @return The content type encoding (upcased)
Expand All @@ -245,7 +245,7 @@ static String getContentTypeEncoding(final String httpContentType) {
}

/**
* Gets the MIME type or NULL if httpContentType is NULL.
* Gets the MIME type or {@code null} if httpContentType is {@code null}.
*
* @param httpContentType the HTTP content type
* @return The mime content type
Expand All @@ -265,7 +265,7 @@ static String getContentTypeMime(final String httpContentType) {
}

/**
* Gets the encoding declared in the <?xml encoding=...?>, NULL if none.
* Gets the encoding declared in the <?xml encoding=...?>, {@code null} if none.
*
* @param inputStream InputStream to create the reader from.
* @param guessedEnc guessed encoding
Expand Down Expand Up @@ -855,7 +855,7 @@ private String doRawStream(final BOMInputStream bom, final BOMInputStream pis, f
/**
* Gets the default encoding to use if none is set in HTTP content-type, XML prolog and the rules based on content-type are not adequate.
* <p>
* If it is NULL the content-type based rules are used.
* If it is {@code null} the content-type based rules are used.
* </p>
*
* @return the default encoding to use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static class MockXmlStreamReader extends XmlStreamReader {
}
private static final String RAWMGS1 = "encoding mismatch";
private static final String RAWMGS2 = "unknown BOM";
private static final String HTTPMGS1 = "BOM must be NULL";
private static final String HTTPMGS1 = "BOM must be null";
private static final String HTTPMGS2 = "encoding mismatch";

private static final String HTTPMGS3 = "Illegal MIME";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public class XmlStreamReader extends Reader {
"Illegal encoding, BOM [{0}] XML guess [{1}] XML prolog [{2}] unknown BOM");

private static final MessageFormat HTTP_EX_1 = new MessageFormat(
"Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], BOM must be NULL");
"Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], BOM must be null");

private static final MessageFormat HTTP_EX_2 = new MessageFormat(
"Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], encoding mismatch");

private static final MessageFormat HTTP_EX_3 = new MessageFormat(
"Illegal encoding, CT-MIME [{0}] CT-Enc [{1}] BOM [{2}] XML guess [{3}] XML prolog [{4}], Illegal MIME");

// returns the BOM in the stream, NULL if not present,
// returns the BOM in the stream, null if not present,
// if there was BOM the in the stream it is consumed
static String getBOMEncoding(final BufferedInputStream is)
throws IOException {
Expand Down Expand Up @@ -141,8 +141,8 @@ static String getBOMEncoding(final BufferedInputStream is)
return encoding;
}

// returns charset parameter value, NULL if not present, NULL if
// httpContentType is NULL
// returns charset parameter value, null if not present, null if
// httpContentType is null
static String getContentTypeEncoding(final String httpContentType) {
String encoding = null;
if (httpContentType != null) {
Expand All @@ -157,7 +157,7 @@ static String getContentTypeEncoding(final String httpContentType) {
return encoding;
}

// returns MIME type or NULL if httpContentType is NULL
// returns MIME type or null if httpContentType is null
static String getContentTypeMime(final String httpContentType) {
String mime = null;
if (httpContentType != null) {
Expand All @@ -172,7 +172,7 @@ static String getContentTypeMime(final String httpContentType) {
* Returns the default encoding to use if none is set in HTTP content-type,
* XML prolog and the rules based on content-type are not adequate.
* <p>
* If it is NULL the content-type based rules are used.
* If it is null the content-type based rules are used.
*
* @return the default encoding to use.
*/
Expand Down Expand Up @@ -209,7 +209,7 @@ private static String getXMLGuessEncoding(final BufferedInputStream is)
return encoding;
}

// returns the encoding declared in the <?xml encoding=...?>, NULL if none
// returns the encoding declared in the <?xml encoding=...?>, null if none
private static String getXmlProlog(final BufferedInputStream is, final String guessedEnc)
throws IOException {
String encoding = null;
Expand Down Expand Up @@ -278,9 +278,9 @@ static boolean isTextXml(final String mime) {
* Sets the default encoding to use if none is set in HTTP content-type, XML
* prolog and the rules based on content-type are not adequate.
* <p>
* If it is set to NULL the content-type based rules are used.
* If it is set to null the content-type based rules are used.
* <p>
* By default it is NULL.
* By default it is null.
*
* @param encoding charset encoding to default to.
*/
Expand Down

0 comments on commit 72b1f88

Please sign in to comment.