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 FilegetRelativeFile(File workingDirectory, File targetFile) Returns a relative path for the targetFile relative to the base directory.static StringtruncatePath(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
-