org.codehaus.mojo.natives.util
Class FileUtil
java.lang.Object
org.codehaus.mojo.natives.util.FileUtil
public class FileUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtil
public FileUtil()
getRelativeFile
public static File getRelativeFile(File workingDirectory,
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 File[] breakPaths(String paths)
truncatePath
public static String truncatePath(String path,
String baseDirectory)
- Parameters:
path
- StringbaseDirectory
- String
- Returns:
- relative path to a base directory if possible
Copyright © 2011 Codehaus. All Rights Reserved.