public class FileUtils extends Object
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File src,
File destination) |
static Path |
createDirectories(Path path) |
static boolean |
fileExists(String filePathString) |
static File |
resolvePath(File base,
String path)
Resolves a path relative a base directory.
|
static void |
sync(File fullFile)
Copied from Lucene's FSDirectory.fsync(String)
|
public static File resolvePath(File base, String path)
This method does what "new File(base,path)" Should do, if it wasn't completely lame: If path is absolute, then a File for that path is returned; if it's not absolute, then a File is returned using "path" as a child of "base")
public static void copyFile(File src, File destination) throws IOException
IOException
public static void sync(File fullFile) throws IOException
fullFile
- the File to be synced to diskIOException
- if the file could not be syncedpublic static boolean fileExists(String filePathString)
public static Path createDirectories(Path path) throws IOException
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.