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(@NotNull Path directoryToCleanOrSymlink) |
static boolean |
contentEquals(@NotNull Path file1,
@NotNull Path file2) |
static void |
deleteDirectory(@NotNull Path path) |
static boolean |
deleteQuietly(@Nullable Path path) |
static void |
forceDelete(@NotNull Path path) |
static OutputStream |
openOutputStream(Path file) |
static OutputStream |
openOutputStream(Path file,
boolean append) |
static String |
readFileToString(Path path,
Charset encoding) |
static @Nullable Path |
toPath(@Nullable File file) |
static Path |
toRealPathIfNeeded(@NotNull 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 @Nullable Path path)
FileUtils.deleteQuietly(File)
public static void cleanDirectory(@NotNull @NotNull Path directoryToCleanOrSymlink) throws IOException
IOException
FileUtils.cleanDirectory(File)
public static void deleteDirectory(@NotNull @NotNull Path path) throws IOException
IOException
FileUtils.deleteDirectory(File)
public static void forceDelete(@NotNull @NotNull Path path) throws IOException
IOException
FileUtils.forceDelete(File)
public static Path toRealPathIfNeeded(@NotNull @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 @NotNull Path file1, @NotNull @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 © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.
View cookie preferences