Class PathUtils
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.PathUtils
-
public class PathUtils extends java.lang.ObjectSome path utilities.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Modifier Constructor Description privatePathUtils()Prevents external creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static booleanisPattern(java.io.File file)Returns whether (the path to)fileis a pattern (ANT).(package private) static booleanisPattern(java.lang.String path)Returns whether the givenpathis a pattern (ANT).static java.lang.Stringnormalize(java.io.File file)Normalizes the path of the given file to a VIL path string (slash-separated).static java.lang.Stringnormalize(java.lang.String file)Normalizes the path of the given file to a VIL path string (slash-separated).static longnormalizedTime()Normalizes the current system time by callingnormalizeTime(long).static longnormalizeTime(long time)Normalizes the given time in order to make it portable across known operating systems.static longnormalizeTime(java.io.File file)Normalizes the last modification time offile.
-
-
-
Method Detail
-
normalize
public static final java.lang.String normalize(java.io.File file)
Normalizes the path of the given file to a VIL path string (slash-separated).- Parameters:
file- the file to be normalized- Returns:
- the normalized string
-
normalize
public static final java.lang.String normalize(java.lang.String file)
Normalizes the path of the given file to a VIL path string (slash-separated).- Parameters:
file- the file to be normalized- Returns:
- the normalized string
-
normalizeTime
public static final long normalizeTime(long time)
Normalizes the given time in order to make it portable across known operating systems. However, the "approximate" precision of Windows file systems is closer to the real time than Linux file systems (1s precision). Thus, this method normalizes the time by setting the milliseconds to zero. Please note that comparisons for more recent file / timestamps shall include equality to the reduced precision of caused by this method.- Parameters:
time- the time stamp to be normalized- Returns:
- the normalized time
-
normalizeTime
public static final long normalizeTime(java.io.File file)
Normalizes the last modification time offile. This method callsnormalizeTime(long).- Parameters:
file- the file to return the normalized time for- Returns:
- the normalized time
-
normalizedTime
public static final long normalizedTime()
Normalizes the current system time by callingnormalizeTime(long).- Returns:
- the normalized system time
-
isPattern
static boolean isPattern(java.io.File file)
Returns whether (the path to)fileis a pattern (ANT).- Parameters:
file- the file to the path shall be analyzed- Returns:
trueiffileis a pattern,falseif the path tofileis a true path
-
isPattern
static boolean isPattern(java.lang.String path)
Returns whether the givenpathis a pattern (ANT).- Parameters:
path- the path to be analyzed- Returns:
trueifpathis a pattern,falseifpathis a true path
-
-