public class PropertiesUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_ENCODING |
static Pattern |
DETECT_ENCODING_PATTERN |
Constructor and Description |
---|
PropertiesUtil() |
Modifier and Type | Method and Description |
---|---|
static Charset |
detectEncoding(InputStream in)
Detect file encoding from the first line of the property file.
|
public static final Pattern DETECT_ENCODING_PATTERN
public static final Charset DEFAULT_ENCODING
public static Charset detectEncoding(InputStream in) throws IOException
Detect file encoding from the first line of the property file. If the first line in the file doesn't contain the comment with the encoding, it uses ISO-8859-1 as default encoding for backwards compatibility.
The specified stream is closed before this method returns.
in
- The input streamIOException
Copyright © 2019 JBoss by Red Hat. All rights reserved.