public class BambooPathUtils extends Object
Path
s. Do not add methods that do not exist in Apache class to this class,
use BambooFiles
instead.
Any change to this class should pass a full suite of Apache Commons IO unit tests.
See https://hello.atlassian.net/wiki/spaces/BAMBOO/pages/141524177/Testing+BambooPathUtils+against+Apache+Commons+IO+unit+tests for detailsConstructor and Description |
---|
BambooPathUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanDirectory(Path directoryToCleanOrSymlink) |
static boolean |
contentEquals(Path file1,
Path file2) |
static void |
deleteDirectory(Path path) |
static boolean |
deleteQuietly(Path path) |
static void |
forceDelete(Path path) |
static OutputStream |
openOutputStream(Path file) |
static OutputStream |
openOutputStream(Path file,
boolean append) |
static String |
readFileToString(Path path,
Charset encoding) |
static Path |
toPath(File file) |
static Path |
toRealPathIfNeeded(Path maybeSymlink)
Returns a fully dereferenced path (including hardlinks) if the supplied argument is a symlink.
|
static void |
writeStringToFile(Path file,
String data,
Charset charset) |
public static boolean deleteQuietly(@Nullable Path path)
FileUtils.deleteQuietly(File)
public static void cleanDirectory(@NotNull Path directoryToCleanOrSymlink) throws IOException
IOException
FileUtils.cleanDirectory(File)
public static void deleteDirectory(@NotNull Path path) throws IOException
IOException
FileUtils.deleteDirectory(File)
public static void forceDelete(@NotNull Path path) throws IOException
IOException
FileUtils.forceDelete(File)
public static Path toRealPathIfNeeded(@NotNull Path maybeSymlink) throws IOException
IOException
public static void writeStringToFile(Path file, String data, Charset charset) throws IOException
IOException
FileUtils#writeStringToFile(File, String, Charset)}
public static OutputStream openOutputStream(Path file) throws IOException
IOException
FileUtils#openOutputStream(File)}
public static OutputStream openOutputStream(Path file, boolean append) throws IOException
IOException
FileUtils#openOutputStream(File, boolean)}
public static boolean contentEquals(@NotNull Path file1, @NotNull Path file2) throws IOException
IOException
FileUtils.contentEquals(File, File)
public static String readFileToString(Path path, Charset encoding) throws IOException
IOException
FileUtils.readFileToString(File, Charset)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.