|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.services.clientserver.SystemEncodingUtil
public class SystemEncodingUtil
A singleton class that contains useful methods related to encodings.
Nested Class Summary | |
---|---|
static class |
SystemEncodingUtil.DefaultEncodingProvider
Provider for the default encodings that RSE uses. |
Field Summary | |
---|---|
static String |
ENCODING_UTF_8
|
Method Summary | |
---|---|
String |
getEncodingFromBOM(String filePath)
Gets the encoding from the Byte Order Mark (BOM). |
String |
getEnvironmentEncoding()
Gets the encoding of the environment. |
static SystemEncodingUtil |
getInstance()
Returns the singleton instance of the utility class. |
String |
getLocalDefaultEncoding()
Returns the local default encoding as provided by the default encoding provider. |
String |
getXMLFileEncoding(String filePath)
Gets the encoding of an XML file. |
boolean |
isXML(String filePath)
Returns whether the file is an XML file. |
void |
setDefaultEncodingProvider(SystemEncodingUtil.DefaultEncodingProvider p)
Change the default encoding provider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String ENCODING_UTF_8
Method Detail |
---|
public static SystemEncodingUtil getInstance()
public void setDefaultEncodingProvider(SystemEncodingUtil.DefaultEncodingProvider p)
p
- the new encoding provider.public String getLocalDefaultEncoding()
public String getEnvironmentEncoding()
public boolean isXML(String filePath)
filePath
- the file path.
true
if the file is an XML file, false
otherwise.public String getXMLFileEncoding(String filePath) throws IOException
filePath
- the file path.
null
if the encoding could not be determined.
IOException
public String getEncodingFromBOM(String filePath) throws IOException
filePath
- the file path.
null
if there is no BOM.
IOException
|
RSE Release 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |