public class RepositoryUtils extends Object
PackageVersion
s and PackageInfo
rmations.Modifier and Type | Field and Description |
---|---|
static String |
SNAPSHOT
The "-SNAPSHOT"-suffix
|
Modifier and Type | Method and Description |
---|---|
static String |
getContextPath()
Returns the JAXB context-path
org.appng.core.xml.repository . |
static Date |
getDate(PackageInfo packageInfo)
Retrieves the
Date from the given PackageInfo by parsing its timestamp |
static PackageArchive |
getPackage(Repository repo,
File file,
String archiveName)
Checks whether the given file is a valid
PackageArchive and matches to RepositoryMode of the
Repository . |
static boolean |
isNewer(PackageInfo packageA,
PackageInfo packageB)
Checks whether
packageA is newer than packageB . |
static boolean |
isNewer(PackageVersion versionA,
PackageVersion versionB)
Checks whether
versionA is newer than versionB |
static boolean |
isSnapshot(String name)
Check whether the given name represent a snapshot version
|
public static final String SNAPSHOT
public static String getContextPath()
org.appng.core.xml.repository
.public static boolean isNewer(PackageVersion versionA, PackageVersion versionB)
versionA
is newer than versionB
versionA
- versionB
- true
if versionA
is newer than versionB
, false
otherwiseisNewer(PackageInfo, PackageInfo)
public static boolean isNewer(PackageInfo packageA, PackageInfo packageB)
packageA
is newer than packageB
. Comparison is first done by the version and then
by the timestamp of the PackageInfo
.packageA
- packageB
- true
if packageA
is newer than packageB
, false
otherwisegetDate(PackageInfo)
public static Date getDate(PackageInfo packageInfo)
Date
from the given PackageInfo
by parsing its timestamppackageInfo
- the PackageInfo
null
, in case of a ParseException
, the "zero-time" is used)public static boolean isSnapshot(String name)
name
- the nametrue
if the given name contains "-SNAPSHOT", false
otherwisepublic static PackageArchive getPackage(Repository repo, File file, String archiveName)
PackageArchive
and matches to RepositoryMode
of the
Repository
.repo
- the Repository
file
- the file containing the archivearchiveName
- the name of the archivePackageArchive
, if the given file is a valid archive and matches the RepositoryMode
of the Repository
.Copyright © 2011–2019 aiticon GmbH. All rights reserved.