public final class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FIELD_SEPARATOR |
static Pattern |
FS_PATTERN |
static DateFormat |
INDEX_DATE_FORMAT |
static String |
INDEX_FILE_PREFIX |
static String |
INFO |
static String |
NOT_AVAILABLE |
static String |
UINFO |
Modifier and Type | Method and Description |
---|---|
static Record |
allGroups(Collection<String> allGroups)
Creates a record of type
Record.Type.ALL_GROUPS . |
static Record |
descriptor(String repoId)
Creates a record of type
Record.Type.DESCRIPTOR . |
static Properties |
loadProperties(InputStream inputStream)
Creates and loads
Properties from provided InputStream and closes the stream. |
static Properties |
loadProperties(ResourceHandler.Resource resource)
Creates and loads
Properties from provided ResourceHandler.Resource if exists, and closes the resource. |
static String |
nvl(String v)
Helper to translate
null into "NA" (not available) value. |
static String |
renvl(String v)
Helper to translate the "NA" (not available) input into
null value. |
static String |
rootGroup(String groupId)
Returns the "root group" of given groupId.
|
static Record |
rootGroups(Collection<String> rootGroups)
Creates a record of type
Record.Type.ROOT_GROUPS . |
static void |
storeProperties(OutputStream outputStream,
Properties properties)
Saves
Properties to provided OutputStream and closes the stream. |
static void |
storeProperties(WritableResourceHandler.WritableResource writableResource,
Properties properties)
Saves
Properties to provided WritableResourceHandler.WritableResource and closes the resource. |
public static final String INDEX_FILE_PREFIX
public static final DateFormat INDEX_DATE_FORMAT
public static final String FIELD_SEPARATOR
public static final String NOT_AVAILABLE
public static final String UINFO
public static final String INFO
public static final Pattern FS_PATTERN
public static Properties loadProperties(InputStream inputStream) throws IOException
Properties
from provided InputStream
and closes the stream.IOException
public static Properties loadProperties(ResourceHandler.Resource resource) throws IOException
Properties
from provided ResourceHandler.Resource
if exists, and closes the resource. If not
exists, returns null
.IOException
public static void storeProperties(OutputStream outputStream, Properties properties) throws IOException
Properties
to provided OutputStream
and closes the stream.IOException
public static void storeProperties(WritableResourceHandler.WritableResource writableResource, Properties properties) throws IOException
Properties
to provided WritableResourceHandler.WritableResource
and closes the resource.IOException
public static Record descriptor(String repoId)
Record.Type.DESCRIPTOR
.public static Record allGroups(Collection<String> allGroups)
Record.Type.ALL_GROUPS
.public static Record rootGroups(Collection<String> rootGroups)
Record.Type.ROOT_GROUPS
.public static String renvl(String v)
null
value.Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.