Package de.qytera.qtaf.core.util
Class Base64Helper
java.lang.Object
de.qytera.qtaf.core.util.Base64Helper
Class that encodes and decodes base64 Strings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConvert a base64 to its original representationstatic byte[]decodeFileContent(String filepath) Convert a base64 file content to its original byte array representationstatic StringdecodeFileContentAsString(String filepath) Convert a base64 file content to its original string representationstatic StringConvert a string to its base64 representationstatic StringencodeFileContent(String filepath) Convert a file content to its base64 representation
-
Constructor Details
-
Base64Helper
public Base64Helper()
-
-
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
-