Package rs.baselib.util
Class ReleaseRepository
java.lang.Object
rs.baselib.util.ReleaseRepository
public class ReleaseRepository
extends java.lang.Object
Holds information about packages and modules.
- Author:
- ralph
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBASELIB_ARTIFACT_IDstatic java.lang.StringBASELIB_GROUP_IDstatic java.lang.StringBUNDLE_ARTIFACT_IDstatic ReleaseRepositoryINSTANCEThe instance of the repository -
Constructor Summary
Constructors Constructor Description ReleaseRepository()Constructor. -
Method Summary
Modifier and Type Method Description booleanaddBuildProperties(java.io.InputStream in)Add properties from given stream and parse release information with given prefix.booleanaddBuildProperties(java.net.URL url)Add properties from given URL and parse release information with given prefix.booleanaddPomProperties(java.io.InputStream in)Add properties from given stream and parse release information with given prefix.booleanaddPomProperties(java.net.URL url)Add properties from given URL and parse release information with given prefix.booleanaddProperties(java.io.File file)Add properties from given File and parse release information with given prefix.ReleaseInformationaddReleaseInformation(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String name)Add release information in repository using the given properties.ReleaseInformationaddReleaseInformation(java.util.Properties props)Parse release information in repository using the given properties.booleanaddReleaseInformation(ReleaseInformation info)Add the given information to the repository.voiddumpArtifacts()Dumps all release information own log in INFO level.voiddumpArtifacts(java.io.Writer writer)Dumps all release information into the writer.voiddumpArtifacts(Logger log, LogLevel logLevel)Dumps all release information to a log.voiddumpArtifacts(LogLevel logLevel)Dumps all release information to own log.java.util.Collection<ReleaseInformation>getAllInfos()Returns all artifacts.java.util.Collection<ReleaseInformation>getArtifactInfos(java.lang.String groupId)Returns all artifact versions.java.util.Collection<java.lang.String>getArtifacts(java.lang.String groupId)Returns all artifact IDs of a group.java.util.Collection<java.lang.String>getGroups()Returns all group IDs.ReleaseInformationgetReleaseInformation(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)Returns the information for the given artifact.java.util.Collection<ReleaseInformation>getVersionInfos(java.lang.String groupId, java.lang.String artifactId)Returns all artifact versions.java.util.Collection<java.lang.String>getVersions(java.lang.String groupId, java.lang.String artifactId)Returns all versions of an artifact.
-
Field Details
-
INSTANCE
The instance of the repository -
BASELIB_GROUP_ID
public static final java.lang.String BASELIB_GROUP_ID- See Also:
- Constant Field Values
-
BASELIB_ARTIFACT_ID
public static final java.lang.String BASELIB_ARTIFACT_ID- See Also:
- Constant Field Values
-
BUNDLE_ARTIFACT_ID
public static final java.lang.String BUNDLE_ARTIFACT_ID- See Also:
- Constant Field Values
-
-
Constructor Details
-
ReleaseRepository
public ReleaseRepository()Constructor.
-
-
Method Details
-
addProperties
public boolean addProperties(java.io.File file) throws java.io.IOExceptionAdd properties from given File and parse release information with given prefix.- Parameters:
file- file load from- Returns:
- true when the information could be added
- Throws:
java.io.IOException- when the stream cannot be read.
-
addBuildProperties
public boolean addBuildProperties(java.net.URL url) throws java.io.IOExceptionAdd properties from given URL and parse release information with given prefix.- Parameters:
url- url to load from- Returns:
- true when the information could be added
- Throws:
java.io.IOException- when the stream cannot be read.
-
addBuildProperties
public boolean addBuildProperties(java.io.InputStream in) throws java.io.IOExceptionAdd properties from given stream and parse release information with given prefix.- Parameters:
in- stream- Returns:
- true when the information could be added
- Throws:
java.io.IOException- when the stream cannot be read.
-
addPomProperties
public boolean addPomProperties(java.net.URL url) throws java.io.IOExceptionAdd properties from given URL and parse release information with given prefix.- Parameters:
url- url to load from- Returns:
- true when the information could be added
- Throws:
java.io.IOException- when the stream cannot be read.
-
addPomProperties
public boolean addPomProperties(java.io.InputStream in) throws java.io.IOExceptionAdd properties from given stream and parse release information with given prefix.- Parameters:
in- stream- Returns:
- true when the information could be added
- Throws:
java.io.IOException- when the stream cannot be read.
-
addReleaseInformation
public ReleaseInformation addReleaseInformation(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String name)Add release information in repository using the given properties.- Parameters:
groupId- group ID of releaseartifactId- artifact ID of releaseversion- version of releasename- name of release- Returns:
- the information created or null (if any property is null)
-
addReleaseInformation
Parse release information in repository using the given properties.- Parameters:
props- the properties to be parsed- Returns:
- the information found or null
-
addReleaseInformation
Add the given information to the repository.- Parameters:
info- info to be added.- Returns:
- true when the information could be added
-
getGroups
public java.util.Collection<java.lang.String> getGroups()Returns all group IDs.- Returns:
- collection with group IDs
-
getReleaseInformation
public ReleaseInformation getReleaseInformation(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)Returns the information for the given artifact.- Parameters:
groupId- group IDartifactId- artifact IDversion- version- Returns:
- release information or NULL
-
getAllInfos
Returns all artifacts.- Returns:
- collection with group IDs
-
getArtifactInfos
Returns all artifact versions.- Parameters:
groupId- the groupId to check- Returns:
- collection with release information
-
getVersionInfos
public java.util.Collection<ReleaseInformation> getVersionInfos(java.lang.String groupId, java.lang.String artifactId)Returns all artifact versions.- Parameters:
groupId- the groupId to checkartifactId- the artifactId to check- Returns:
- collection with release information
-
getArtifacts
public java.util.Collection<java.lang.String> getArtifacts(java.lang.String groupId)Returns all artifact IDs of a group.- Parameters:
groupId- group ID to return- Returns:
- collection with artifact IDs
-
getVersions
public java.util.Collection<java.lang.String> getVersions(java.lang.String groupId, java.lang.String artifactId)Returns all versions of an artifact.- Parameters:
groupId- group ID to returnartifactId- artifact ID to return- Returns:
- collection with versions
-
dumpArtifacts
public void dumpArtifacts()Dumps all release information own log in INFO level.- Since:
- 1.2.4
-
dumpArtifacts
Dumps all release information to own log.- Parameters:
logLevel- the log level to be used- Since:
- 1.2.4
-
dumpArtifacts
Dumps all release information to a log.- Parameters:
log- the logger to be usedlogLevel- the log level to be used- Since:
- 1.2.4
-
dumpArtifacts
public void dumpArtifacts(java.io.Writer writer) throws java.io.IOExceptionDumps all release information into the writer.- Parameters:
writer- the writer where to dump to- Throws:
java.io.IOException- if I/O exception occurs- Since:
- 1.2.4
-