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