Package de.oktoflow.platform.cmdTools
Class MavenUtils
java.lang.Object
de.oktoflow.platform.cmdTools.MavenUtils
Some Maven utility functions. Taken over from Qualimaster.
- Author:
- Holger Eichelberger, Pastuschek
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSome cleanup statistics. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MavenUtils.CleanupStatisticscleanSnapshots(int generations) Cleans up snapshots in the actual repository.private static voidcleanSnapshots(File dir, int generations, MavenUtils.CleanupStatistics statistics) Cleans the snapshots indir.private static voidcleanSnapshotsInRepositoryDir(File base, int generations, MavenUtils.CleanupStatistics statistics) Cleans the snapshots inbase.private static final IntegergetGeneration(String name) Returns the snapshot generation inname.static StringhumanReadableByteCount(long bytes, boolean si) Returns an amount of bytes in human readable format.private static booleanisSnapshotDir(File file) Returns whetherfileis a snapshot directory.static StringReturns the path to the maven repository.
-
Field Details
-
SNAPSHOT_SUFFIX
- See Also:
-
-
Constructor Details
-
MavenUtils
public MavenUtils()
-
-
Method Details
-
mavenRepository
Returns the path to the maven repository.- Returns:
- the path
-
cleanSnapshots
Cleans up snapshots in the actual repository.- Parameters:
generations- the number of generations to keep (always at least 1)- Returns:
- cleanup statistics
-
isSnapshotDir
Returns whetherfileis a snapshot directory.- Parameters:
file- the file to consider- Returns:
truefor snapshot,falseelse
-
cleanSnapshotsInRepositoryDir
private static void cleanSnapshotsInRepositoryDir(File base, int generations, MavenUtils.CleanupStatistics statistics) Cleans the snapshots inbase.- Parameters:
base- the directory to clear recursivelygenerations- the number of generations to keepstatistics- cleanup statistics (to be modified as a side effect)
-
cleanSnapshots
private static void cleanSnapshots(File dir, int generations, MavenUtils.CleanupStatistics statistics) Cleans the snapshots indir.- Parameters:
dir- the directory to cleargenerations- the number of generations to keepstatistics- cleanup statistics (to be modified as a side effect)
-
getGeneration
Returns the snapshot generation inname.- Parameters:
name- the file name- Returns:
- the snapshot generation or null if none was identifier
-
humanReadableByteCount
Returns an amount of bytes in human readable format.- Parameters:
bytes- the number of bytessi- use SI units (based on 1000 iftrue) or 1024 as base (false)- Returns:
- the human readable string representation
-