Constructor and Description |
---|
SeparatedValuesFile(File file)
Builds a new SeparatedValuesFile reading the given
file using a the Separators.COMMA
separator specification and UTF-8 charset. |
SeparatedValuesFile(File file,
Charset charset)
Builds a new SeparatedValuesFile reading the given
file using a the Separators.COMMA
separator specification. |
SeparatedValuesFile(File file,
Charset charset,
Separator separator)
Builds a new SeparatedValuesFile reading the given
file . |
SeparatedValuesFile(File file,
Charset charset,
Separator separator,
boolean header)
Builds a new SeparatedValuesFile reading the given
file . |
Modifier and Type | Method and Description |
---|---|
List<String> |
getFields()
Returns the explicit field keys in the order they appear in a record, overriding any existing field header,
or empty to use field header.
|
Map<String,String> |
getRecord(String key,
String value)
Returns a record from the file where the specified key is equal to the specified value.
|
public SeparatedValuesFile(File file)
file
using a the Separators.COMMA
separator specification and UTF-8
charset. This constructor consider the file has a header line.
It is equivalent to call:
new SeparatedValuesFile(file, "UTF-8");
file
- file to read fromSeparatedValuesFile(File, Charset)
public SeparatedValuesFile(File file, Charset charset)
file
using a the Separators.COMMA
separator specification. This constructor consider the file has a header line.
It is equivalent to call:
new SeparatedValuesFile(file, charset, Separators.COMMA.getSeparator());
file
- file to read fromcharset
- Charset
of the file (non-null)SeparatedValuesFile(File, Charset, Separator)
public SeparatedValuesFile(File file, Charset charset, Separator separator)
file
. This constructor consider the file has a header
line.
It is equivalent to call:
new SeparatedValuesFile(file, charset, separator, true);
file
- file to read fromcharset
- Charset
of the file (non-null)separator
- separator specificationSeparatedValuesFile(File, Charset, Separator, boolean)
public SeparatedValuesFile(File file, Charset charset, Separator separator, boolean header)
file
.file
- file to read fromcharset
- Charset
of the file (non-null)separator
- separator specificationheader
- does the file has a header first line ?public List<String> getFields()
public Map<String,String> getRecord(String key, String value) throws IOException
key
- the key to use to lookup the recordvalue
- the value that the key should have to find a matching record.null
if no such record could be found.IOException
- if an I/O exception occurs.Copyright © 2025 Open Identity Platform Community. All rights reserved.