Package org.codehaus.mojo.natives.util
Class FileUtil
- java.lang.Object
-
- org.codehaus.mojo.natives.util.FileUtil
-
public class FileUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.io.File[]
breakPaths(java.lang.String paths)
static java.io.File
getRelativeFile(java.io.File workingDirectory, java.io.File targetFile)
Returns a relative path for the targetFile relative to the base directory.static java.lang.String
truncatePath(java.lang.String path, java.lang.String baseDirectory)
-
-
-
Method Detail
-
getRelativeFile
public static java.io.File getRelativeFile(java.io.File workingDirectory, java.io.File targetFile)
Returns a relative path for the targetFile relative to the base directory.- Parameters:
canonicalBase
- base directory as returned by File.getCanonicalPath()targetFile
- target file- Returns:
- relative path of target file. Returns targetFile if there were no commonalities between the base and the target
-
breakPaths
public static java.io.File[] breakPaths(java.lang.String paths)
-
truncatePath
public static java.lang.String truncatePath(java.lang.String path, java.lang.String baseDirectory)
- Parameters:
path
- StringbaseDirectory
- String- Returns:
- relative path to a base directory if possible
-
-