replace apache base64 with java base64
continued from cbevard1
removed apache commons base64 encoding/decoding
removed unused commons-codec dependency
I'm pretty sure that org.apache.commons.codec.binary.Base64 as used here is based on the RFC2045 spec, which is not the same as java.util.Base64.getDecoder / java.util.Base64.getEncoder, which could cause issues for any existing data that we have encoded
I think you want java.util.Base64.getMimeDecoder / java.util.Base64.getMimeEncoder to remain backward-compatible with any existing data
I will double check but from what I see, the encoder we were using from apache does not cut the data up into 76 character lines: "encodeBase64(byte[] binaryData) Encodes binary data using the base64 algorithm but does not chunk the output." so the basic java encoder should work fine "Uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for encoding and decoding operation. The encoder does not add any line feed (line separator) character."
I'm pretty sure that org.apache.commons.codec.binary.Base64 as used here is based on the RFC2045 spec, which is not the same as java.util.Base64.getDecoder / java.util.Base64.getEncoder, which could cause issues for any existing data that we have encoded
I think you want java.util.Base64.getMimeDecoder / java.util.Base64.getMimeEncoder to remain backward-compatible with any existing data
I ran a test and this is the output:
original:cGxjc2RyZmdkdmhlYmFleXR2cXRwdGh3amtld2txbXF6emhsY3ZkdWhobmJvbmxxaWNlY3l2Z25pcmJpZWFhdmF3bmV4d3d6anlydWhycG91d2Rydm1kdW9qZ3Ria2Jk java:cGxjc2RyZmdkdmhlYmFleXR2cXRwdGh3amtld2txbXF6emhsY3ZkdWhobmJvbmxxaWNlY3l2Z25pcmJpZWFhdmF3bmV4d3d6anlydWhycG91d2Rydm1kdW9qZ3Ria2Jk mime:cGxjc2RyZmdkdmhlYmFleXR2cXRwdGh3amtld2txbXF6emhsY3ZkdWhobmJvbmxxaWNlY3l2Z25p cmJpZWFhdmF3bmV4d3d6anlydWhycG91d2Rydm1kdW9qZ3Ria2Jk
the mime one split the text but the original apache and the java I replaced it with did not and have the same output so it should be ok.
Reopen and address conflicts as priorities allow