Package org.apache.maven.index.reader
Class Utils
java.lang.Object
org.apache.maven.index.reader.Utils
Reusable code snippets and constants.
- Since:
- 5.1.2
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Record
allGroups
(Collection<String> allGroups) Creates a record of typeRecord.Type.ALL_GROUPS
.static Record
descriptor
(String repoId) Creates a record of typeRecord.Type.DESCRIPTOR
.static Properties
loadProperties
(InputStream inputStream) Creates and loadsProperties
from providedInputStream
and closes the stream.static Properties
loadProperties
(ResourceHandler.Resource resource) Creates and loadsProperties
from providedResourceHandler.Resource
if exists, and closes the resource.static String
Helper to translatenull
into "NA" (not available) value.static String
Helper to translate the "NA" (not available) input intonull
value.static String
Returns the "root group" of given groupId.static Record
rootGroups
(Collection<String> rootGroups) Creates a record of typeRecord.Type.ROOT_GROUPS
.static void
storeProperties
(OutputStream outputStream, Properties properties) SavesProperties
to providedOutputStream
and closes the stream.static void
storeProperties
(WritableResourceHandler.WritableResource writableResource, Properties properties) SavesProperties
to providedWritableResourceHandler.WritableResource
and closes the resource.
-
Field Details
-
INDEX_FILE_PREFIX
- See Also:
-
INDEX_DATE_FORMAT
-
FIELD_SEPARATOR
- See Also:
-
NOT_AVAILABLE
- See Also:
-
UINFO
- See Also:
-
INFO
- See Also:
-
FS_PATTERN
-
-
Method Details
-
loadProperties
Creates and loadsProperties
from providedInputStream
and closes the stream.- Throws:
IOException
-
loadProperties
Creates and loadsProperties
from providedResourceHandler.Resource
if exists, and closes the resource. If not exists, returnsnull
.- Throws:
IOException
-
storeProperties
public static void storeProperties(OutputStream outputStream, Properties properties) throws IOException SavesProperties
to providedOutputStream
and closes the stream.- Throws:
IOException
-
storeProperties
public static void storeProperties(WritableResourceHandler.WritableResource writableResource, Properties properties) throws IOException SavesProperties
to providedWritableResourceHandler.WritableResource
and closes the resource.- Throws:
IOException
-
descriptor
Creates a record of typeRecord.Type.DESCRIPTOR
. -
allGroups
Creates a record of typeRecord.Type.ALL_GROUPS
. -
rootGroups
Creates a record of typeRecord.Type.ROOT_GROUPS
. -
renvl
Helper to translate the "NA" (not available) input intonull
value. -
nvl
Helper to translatenull
into "NA" (not available) value. -
rootGroup
Returns the "root group" of given groupId.
-