|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
com.wewebu.ow.server.util.OwResourceProperties
public class OwResourceProperties
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
Field Summary | |
---|---|
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]. |
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
OwResourceProperties()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BOM_SIZE
For more Information read: http://unicode.org/faq/utf_bom.html#BOM
Constructor Detail |
---|
public OwResourceProperties()
Method Detail |
---|
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 resource
IOException
- 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 Properties
reader_p
- Any Reader extending the java.io.Reader class.
IOException
public static String getResourceEncoding(URL url_p) throws IOException
url_p
- URL to the specific resource
IOException
getResourceEncoding(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
- PushbackInputStream
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |