Skip to content

Commit 2df7b9a

Browse files
committed
Javadoc and exception messages: "base 64" -> "Base64".
1 parent 0643fdd commit 2df7b9a

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

  • src/main/java/org/apache/commons/codec/binary

src/main/java/org/apache/commons/codec/binary/Base64.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,15 @@ public static boolean isArrayByteBase64(final byte[] arrayOctet) {
601601
}
602602

603603
/**
604-
* Tests whether or not the {@code octet} is in the base 64 alphabet.
604+
* Tests whether or not the {@code octet} is in the Base64 alphabet.
605605
* <p>
606606
* This method threats all characters included within standard base64 and base64url encodings as valid base64 characters. This includes the '+' and '/'
607607
* (standard base64), as well as '-' and '_' (URL-safe base64) characters. For enforcing verification against strict standard Base64 or Base64 URL-safe
608608
* tables, please use {@link #isBase64Standard(byte)} or {@link #isBase64Url(byte)} methods respectively.
609609
* </p>
610610
*
611611
* @param octet The value to test.
612-
* @return {@code true} if the value is defined in the base 64 alphabet, {@code false} otherwise.
612+
* @return {@code true} if the value is defined in the Base64 alphabet, {@code false} otherwise.
613613
* @since 1.4
614614
*/
615615
public static boolean isBase64(final byte octet) {
@@ -654,14 +654,14 @@ public static boolean isBase64(final String base64) {
654654
}
655655

656656
/**
657-
* Tests whether or not the {@code octet} is in the standard base 64 alphabet.
657+
* Tests whether or not the {@code octet} is in the standard Base64 alphabet.
658658
* <p>
659659
* This implementation is aligned with <a href="https://www.ietf.org/rfc/rfc2045#:~:text=Table%201%3A%20The%20Base64%20Alphabet">RFC 2045 Table 1: The
660660
* Base64 Alphabet</a>.
661661
* </p>
662662
*
663663
* @param octet The value to test.
664-
* @return {@code true} if the value is defined in the standard base 64 alphabet, {@code false} otherwise.
664+
* @return {@code true} if the value is defined in the standard Base64 alphabet, {@code false} otherwise.
665665
* @since 1.21
666666
*/
667667
public static boolean isBase64Standard(final byte octet) {
@@ -705,15 +705,15 @@ public static boolean isBase64Standard(final String base64) {
705705
}
706706

707707
/**
708-
* Tests whether or not the {@code octet} is in the URL-safe base 64 alphabet.
708+
* Tests whether or not the {@code octet} is in the URL-safe Base64 alphabet.
709709
* <p>
710710
* This implementation is aligned with
711711
* <a href="https://datatracker.ietf.org/doc/html/rfc4648#:~:text=Table%202%3A%20The%20%22URL%20and%20Filename%20safe%22%20Base%2064%20Alphabet">RFC 4648
712712
* Table 2: The "URL and Filename safe" Base 64 Alphabet</a>.
713713
* </p>
714714
*
715715
* @param octet The value to test.
716-
* @return {@code true} if the value is defined in the URL-safe base 64 alphabet, {@code false} otherwise.
716+
* @return {@code true} if the value is defined in the URL-safe Base64 alphabet, {@code false} otherwise.
717717
* @since 1.21
718718
*/
719719
public static boolean isBase64Url(final byte octet) {
@@ -1164,7 +1164,7 @@ public boolean isUrlSafe() {
11641164
}
11651165

11661166
/**
1167-
* Validates whether decoding the final trailing character is possible in the context of the set of possible base 64 values.
1167+
* Validates whether decoding the final trailing character is possible in the context of the set of possible Base64 values.
11681168
* <p>
11691169
* The character is valid if the lower bits within the provided mask are zero. This is used to test the final trailing base-64 digit is zero in the bits
11701170
* that will be discarded.
@@ -1176,10 +1176,8 @@ public boolean isUrlSafe() {
11761176
*/
11771177
private void validateCharacter(final int emptyBitsMask, final Context context) {
11781178
if (isStrictDecoding() && (context.ibitWorkArea & emptyBitsMask) != 0) {
1179-
throw new IllegalArgumentException(
1180-
"Strict decoding: Last encoded character (before the paddings if any) is a valid " +
1181-
"base 64 alphabet but not a possible encoding. " +
1182-
"Expected the discarded bits from the character to be zero.");
1179+
throw new IllegalArgumentException("Strict decoding: Last encoded character (before the paddings if any) is a valid "
1180+
+ "Base64 alphabet but not a possible encoding. Expected the discarded bits from the character to be zero.");
11831181
}
11841182
}
11851183

@@ -1190,10 +1188,8 @@ private void validateCharacter(final int emptyBitsMask, final Context context) {
11901188
*/
11911189
private void validateTrailingCharacter() {
11921190
if (isStrictDecoding()) {
1193-
throw new IllegalArgumentException(
1194-
"Strict decoding: Last encoded character (before the paddings if any) is a valid " +
1195-
"base 64 alphabet but not a possible encoding. " +
1196-
"Decoding requires at least two trailing 6-bit characters to create bytes.");
1191+
throw new IllegalArgumentException("Strict decoding: Last encoded character (before the paddings if any) is a valid "
1192+
+ "Base64 alphabet but not a possible encoding. Decoding requires at least two trailing 6-bit characters to create bytes.");
11971193
}
11981194
}
11991195

0 commit comments

Comments
 (0)