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