Class FileUtil

java.lang.Object
com.google.gerrit.common.FileUtil

public class FileUtil extends Object
  • Method Details

    • modified

      public static boolean modified(org.eclipse.jgit.storage.file.FileBasedConfig cfg) throws IOException
      Throws:
      IOException
    • mkdir

      public static void mkdir(File path)
    • chmod

      public static void chmod(int mode, Path path)
    • chmod

      public static void chmod(int mode, File path)
    • lastModified

      public static long lastModified(Path p)
      Get the last modified time of a path.

      Equivalent to File#lastModified(), returning 0 on errors, including file not found. Callers that prefer exceptions can use Files.getLastModifiedTime(Path, java.nio.file.LinkOption...).

      Parameters:
      p - path.
      Returns:
      last modified time, in milliseconds since epoch.
    • mkdirsOrDie

      @CanIgnoreReturnValue public static Path mkdirsOrDie(Path p, String errMsg)