Package de.qytera.qtaf.core.util
Class Base64Helper
java.lang.Object
de.qytera.qtaf.core.util.Base64Helper
Class that encodes and decodes base64 Strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringConvert a base64 to its original representation.static byte[]decodeFileContent(String filepath) Convert a base64 file content to its original byte array representation.static StringdecodeFileContentAsString(String filepath) Convert a base64 file content to its original string representation.static StringConvert a string to its base64 representation.static StringencodeFileContent(String filepath) Convert a file content to its base64 representation.
-
Method Details
-
encode
Convert a string to its base64 representation.- Parameters:
input- String input- Returns:
- base64 string
-
encodeFileContent
Convert a file content to its base64 representation.- Parameters:
filepath- Path to a file- Returns:
- base64 string
- Throws:
IOException- error if file does not exist
-
decode
Convert a base64 to its original representation.- Parameters:
input- Base64 String input- Returns:
- original string
-
decodeFileContent
Convert a base64 file content to its original byte array representation.- Parameters:
filepath- Path to a file- Returns:
- original string
- Throws:
IOException- error if file does not exist
-
decodeFileContentAsString
Convert a base64 file content to its original string representation.- Parameters:
filepath- Path to a file- Returns:
- original string
- Throws:
IOException- error if file does not exist
-