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://extranet.atlassian.com/display/BAMBOO/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 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 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)}
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.