Package org.apache.maven.index.reader
Class Utils
- java.lang.Object
-
- org.apache.maven.index.reader.Utils
-
public final class Utils extends java.lang.ObjectReusable code snippets and constants.- Since:
- 5.1.2
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFIELD_SEPARATORstatic java.util.regex.PatternFS_PATTERNstatic java.text.DateFormatINDEX_DATE_FORMATstatic java.lang.StringINDEX_FILE_PREFIXstatic java.lang.StringINFOstatic java.lang.StringNOT_AVAILABLEstatic java.lang.StringUINFO
-
Constructor Summary
Constructors Modifier Constructor Description privateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RecordallGroups(java.util.Collection<java.lang.String> allGroups)Creates a record of typeRecord.Type.ALL_GROUPS.static Recorddescriptor(java.lang.String repoId)Creates a record of typeRecord.Type.DESCRIPTOR.static java.util.PropertiesloadProperties(java.io.InputStream inputStream)Creates and loadsPropertiesfrom providedInputStreamand closes the stream.static java.util.PropertiesloadProperties(ResourceHandler.Resource resource)Creates and loadsPropertiesfrom providedResourceHandler.Resourceif exists, and closes the resource.static java.lang.Stringnvl(java.lang.String v)Helper to translatenullinto "NA" (not available) value.static java.lang.Stringrenvl(java.lang.String v)Helper to translate the "NA" (not available) input intonullvalue.static java.lang.StringrootGroup(java.lang.String groupId)Returns the "root group" of given groupId.static RecordrootGroups(java.util.Collection<java.lang.String> rootGroups)Creates a record of typeRecord.Type.ROOT_GROUPS.static voidstoreProperties(java.io.OutputStream outputStream, java.util.Properties properties)SavesPropertiesto providedOutputStreamand closes the stream.static voidstoreProperties(WritableResourceHandler.WritableResource writableResource, java.util.Properties properties)SavesPropertiesto providedWritableResourceHandler.WritableResourceand closes the resource.
-
-
-
Field Detail
-
INDEX_FILE_PREFIX
public static final java.lang.String INDEX_FILE_PREFIX
- See Also:
- Constant Field Values
-
INDEX_DATE_FORMAT
public static final java.text.DateFormat INDEX_DATE_FORMAT
-
FIELD_SEPARATOR
public static final java.lang.String FIELD_SEPARATOR
- See Also:
- Constant Field Values
-
NOT_AVAILABLE
public static final java.lang.String NOT_AVAILABLE
- See Also:
- Constant Field Values
-
UINFO
public static final java.lang.String UINFO
- See Also:
- Constant Field Values
-
INFO
public static final java.lang.String INFO
- See Also:
- Constant Field Values
-
FS_PATTERN
public static final java.util.regex.Pattern FS_PATTERN
-
-
Method Detail
-
loadProperties
public static java.util.Properties loadProperties(java.io.InputStream inputStream) throws java.io.IOExceptionCreates and loadsPropertiesfrom providedInputStreamand closes the stream.- Throws:
java.io.IOException
-
loadProperties
public static java.util.Properties loadProperties(ResourceHandler.Resource resource) throws java.io.IOException
Creates and loadsPropertiesfrom providedResourceHandler.Resourceif exists, and closes the resource. If not exists, returnsnull.- Throws:
java.io.IOException
-
storeProperties
public static void storeProperties(java.io.OutputStream outputStream, java.util.Properties properties) throws java.io.IOExceptionSavesPropertiesto providedOutputStreamand closes the stream.- Throws:
java.io.IOException
-
storeProperties
public static void storeProperties(WritableResourceHandler.WritableResource writableResource, java.util.Properties properties) throws java.io.IOException
SavesPropertiesto providedWritableResourceHandler.WritableResourceand closes the resource.- Throws:
java.io.IOException
-
descriptor
public static Record descriptor(java.lang.String repoId)
Creates a record of typeRecord.Type.DESCRIPTOR.
-
allGroups
public static Record allGroups(java.util.Collection<java.lang.String> allGroups)
Creates a record of typeRecord.Type.ALL_GROUPS.
-
rootGroups
public static Record rootGroups(java.util.Collection<java.lang.String> rootGroups)
Creates a record of typeRecord.Type.ROOT_GROUPS.
-
renvl
public static java.lang.String renvl(java.lang.String v)
Helper to translate the "NA" (not available) input intonullvalue.
-
nvl
public static java.lang.String nvl(java.lang.String v)
Helper to translatenullinto "NA" (not available) value.
-
rootGroup
public static java.lang.String rootGroup(java.lang.String groupId)
Returns the "root group" of given groupId.
-
-