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 currentPackage,
PackageInfo latestPackage)
Checks whether
currentPackage is newer than latestPackage |
static boolean |
isNewer(PackageVersion currentPackage,
PackageVersion latestPackage)
Checks whether
currentPackage is newer than latestPackage |
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 currentPackage, PackageVersion latestPackage)
currentPackage
is newer than latestPackage
currentPackage
- latestPackage
- true
if currentPackage
is newer than latestPackage
, false
otherwiseisNewer(PackageInfo, PackageInfo)
public static boolean isNewer(PackageInfo currentPackage, PackageInfo latestPackage)
currentPackage
is newer than latestPackage
currentPackage
- latestPackage
- true
if currentPackage
is newer than latestPackage
, 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–2017 aiticon GmbH. All rights reserved.