public abstract class TextualFileConverter extends Object
| Constructor and Description |
|---|
TextualFileConverter() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
convert(String textualFileAsString)
Convert the textual file loaded at the
String to another format, represented by a byte array, using the default machine charset. |
byte[] |
convert(String textualFileAsString,
Charset charset)
Convert the textual file loaded at the
String to another format, represented by a byte array, using an specific charset. |
abstract byte[] |
doConvert(String textualFileAsString,
Charset charset)
Convert the textual file loaded at the
String to another format, represented by a byte array, using an specific charset. |
abstract String |
getContentType() |
abstract String |
getFileExtension() |
public byte[] convert(String textualFileAsString) throws Exception
String to another format, represented by a byte array, using the default machine charset.textualFileAsString - loaded file contents.Exception - in case of error at conversion.public byte[] convert(String textualFileAsString, Charset charset) throws Exception
String to another format, represented by a byte array, using an specific charset.textualFileAsString - loaded file contents.charset - charset to use. If null should use VM's default.Exception - in case of error at conversion.public abstract byte[] doConvert(String textualFileAsString, Charset charset) throws Exception
String to another format, represented by a byte array, using an specific charset.textualFileAsString - loaded file contents.charset - charset to use. Never null.Exception - in case of error at conversion.public abstract String getContentType()
String with the converted ContentType, usually used for Servlet responses.Copyright © 2015. All rights reserved.