public class OwResourceProperties extends Properties
Class which upgrades the java.util.Properties with several methods.
Also needed to read .properties files with different encoding, if there are saved in
using a unicode encoding.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
| Modifier and Type | Field and Description |
|---|---|
static int |
BOM_SIZE
Bytes to be read for analyze UNICODE (UTF-8, UTF-16BE, UTF-16LE,
UTF-32BE, UTF-32LE) information [Byte Order Mark].
|
defaults| Constructor and Description |
|---|
OwResourceProperties() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getResourceEncoding(byte[] analyse_p)
Static function for analyzing the BOM of a file, and returning an
encoding or null if no valid BOM is defined.
|
static String |
getResourceEncoding(PushbackInputStream pushStream)
Reads encoding type and skips BOM bits
|
static String |
getResourceEncoding(URL url_p)
Static function for analyzing resource defined by the URL.
|
void |
load(Reader reader_p)
Since the Alfresco Workdesk is supporting also the JRE 1.4.2, the java.util.Properties
are also upgraded with a
load(Reader) method - like in java 6. |
void |
load(URL resource_p)
Upgrade of standard java.util.Properties, so we can analyze the encoding of the file.
|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamespublic static final int BOM_SIZE
For more Information read: http://unicode.org/faq/utf_bom.html#BOM
public void load(URL resource_p) throws IOException
load(Reader) method
and a reader with the specified character encoding to read and convert
the contained strings.resource_p - URL to the specific resourceIOException - throws if as example the resource was not found.public void load(Reader reader_p) throws IOException
load(Reader) method - like in java 6.
This method reads a properties file, using the specified character
encoding of the Reader.load in class Propertiesreader_p - Any Reader extending the java.io.Reader class.IOExceptionpublic static String getResourceEncoding(URL url_p) throws IOException
url_p - URL to the specific resourceIOExceptiongetResourceEncoding(byte[])public static String getResourceEncoding(byte[] analyse_p)
analyse_p - byte[4] BOM (= Byte Order Mark) - the first 4 bytes of a file or resource.public static String getResourceEncoding(PushbackInputStream pushStream) throws IOException
pushStream - PushbackInputStreamIOExceptionCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.