Package com.google.gerrit.common
Class FileUtil
- java.lang.Object
-
- com.google.gerrit.common.FileUtil
-
public class FileUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
chmod(int mode, File path)
static void
chmod(int mode, Path path)
static long
lastModified(Path p)
Get the last modified time of a path.static void
mkdir(File path)
static Path
mkdirsOrDie(Path p, String errMsg)
static boolean
modified(org.eclipse.jgit.storage.file.FileBasedConfig cfg)
-
-
-
Method Detail
-
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 useFiles.getLastModifiedTime(Path, java.nio.file.LinkOption...)
.- Parameters:
p
- path.- Returns:
- last modified time, in milliseconds since epoch.
-
-