Class FileUtil

java.lang.Object
org.codehaus.mojo.natives.util.FileUtil

public class FileUtil extends Object
  • Constructor Details

    • FileUtil

      public FileUtil()
  • Method Details

    • 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 - String
      baseDirectory - String
      Returns:
      relative path to a base directory if possible