public class FileUtil extends Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canExecute(File path) |
static void |
createSymLink(File path,
String target) |
static void |
delete(File path) |
static boolean |
exists(File path) |
static FS.Attributes |
getFileAttributesPosix(FS fs,
File path) |
static long |
getLength(File path) |
static boolean |
isDirectory(File path) |
static boolean |
isFile(File path) |
static boolean |
isHidden(File path) |
static boolean |
isSymlink(File path) |
static long |
lastModified(File path) |
static File |
normalize(File file) |
static String |
normalize(String name) |
static String |
readSymlink(File path) |
static void |
setHidden(File path,
boolean hidden) |
static void |
setLastModified(File path,
long time) |
public static String readSymlink(File path) throws IOException
path
- IOException
public static void createSymLink(File path, String target) throws IOException
path
- path of the symlink to be createdtarget
- target of the symlink to be createdIOException
public static boolean isSymlink(File path)
path
- true
if the passed path is a symlinkpublic static long lastModified(File path) throws IOException
path
- IOException
public static void setLastModified(File path, long time) throws IOException
path
- time
- IOException
public static boolean exists(File path)
path
- true
if the given path existspublic static boolean isHidden(File path) throws IOException
path
- true
if the given path is hiddenIOException
public static void setHidden(File path, boolean hidden) throws IOException
path
- hidden
- IOException
public static long getLength(File path) throws IOException
path
- IOException
public static boolean isDirectory(File path)
path
- true
if the given file a directorypublic static boolean isFile(File path)
path
- true
if the given file is a filepublic static boolean canExecute(File path)
path
- true
if the given file can be executedpublic static void delete(File path) throws IOException
path
- IOException
public static FS.Attributes getFileAttributesPosix(FS fs, File path)
fs
- path
- public static File normalize(File file)
file
- File
, otherwise the passed fileCopyright © 2015 Eclipse JGit Project. All rights reserved.