Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/codehaus/plexus/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ public static void forceDelete(final String file) throws IOException {
*/
public static void forceDelete(final File file) throws IOException {
if (file.isDirectory()) {
deleteDirectory(file);
org.apache.commons.io.FileUtils.deleteDirectory(file);
} else {
/*
* NOTE: Always try to delete the file even if it appears to be non-existent. This will ensure that a
Expand Down Expand Up @@ -1321,7 +1321,7 @@ public static void forceMkdir(final File file) throws IOException {
* @throws IOException if any
*/
public static void deleteDirectory(final String directory) throws IOException {
deleteDirectory(new File(directory));
org.apache.commons.io.FileUtils.deleteDirectory(new File(directory));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void regexExcludeWithNegativeLookahead() throws IOException {

File dir = new File(testDir, "regex-dir");
try {
FileUtils.deleteDirectory(dir);
org.apache.commons.io.FileUtils.deleteDirectory(dir);
} catch (IOException ignored) {
}

Expand Down Expand Up @@ -471,7 +471,7 @@ void regexWithSlashInsideCharacterClass() throws IOException {

File dir = new File(testDir, "regex-dir");
try {
FileUtils.deleteDirectory(dir);
org.apache.commons.io.FileUtils.deleteDirectory(dir);
} catch (IOException ignored) {
}

Expand Down
16 changes: 8 additions & 8 deletions src/test/java/org/codehaus/plexus/util/FileUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void setUp() throws Exception {
getTestDirectory().mkdirs();
createFile(testFile1, testFile1Size);
createFile(testFile2, testFile2Size);
FileUtils.deleteDirectory(getTestDirectory());
org.apache.commons.io.FileUtils.deleteDirectory(getTestDirectory());
getTestDirectory().mkdirs();
createFile(testFile1, testFile1Size);
createFile(testFile2, testFile2Size);
Expand Down Expand Up @@ -942,7 +942,7 @@ void removeExtensionWithPaths() {
void copyDirectoryStructureWithAEmptyDirectoryStructure() throws Exception {
File from = new File(getTestDirectory(), "from");

FileUtils.deleteDirectory(from);
org.apache.commons.io.FileUtils.deleteDirectory(from);

assertTrue(from.mkdirs());

Expand All @@ -963,7 +963,7 @@ void copyDirectoryStructureWithAPopulatedStructure() throws Exception {
// Make a structure to copy
File from = new File(getTestDirectory(), "from");

FileUtils.deleteDirectory(from);
org.apache.commons.io.FileUtils.deleteDirectory(from);

File fRoot = new File(from, "root.txt");

Expand Down Expand Up @@ -1026,7 +1026,7 @@ void copyDirectoryStructureIfModified() throws Exception {
// Make a structure to copy
File from = new File(getTestDirectory(), "from");

FileUtils.deleteDirectory(from);
org.apache.commons.io.FileUtils.deleteDirectory(from);

File fRoot = new File(from, "root.txt");

Expand Down Expand Up @@ -1108,7 +1108,7 @@ void copyDirectoryStructureToSelf() throws Exception {
// Make a structure to copy
File toFrom = new File(getTestDirectory(), "tofrom");

FileUtils.deleteDirectory(toFrom);
org.apache.commons.io.FileUtils.deleteDirectory(toFrom);

File fRoot = new File(toFrom, "root.txt");

Expand Down Expand Up @@ -1505,7 +1505,7 @@ void deleteDirectoryWithValidFileSymlink() throws Exception {
File symlink = new File(getTestDirectory(), "fileSymlink");
createSymlink(symlink, symlinkTarget);
try {
FileUtils.deleteDirectory(getTestDirectory());
org.apache.commons.io.FileUtils.deleteDirectory(getTestDirectory());
} finally {
/*
* Ensure to cleanup problematic symlink or "mvn clean" will fail
Expand All @@ -1527,7 +1527,7 @@ void deleteDirectoryWithValidDirSymlink() throws Exception {
File symlink = new File(getTestDirectory(), "dirSymlink");
createSymlink(symlink, symlinkTarget);
try {
FileUtils.deleteDirectory(getTestDirectory());
org.apache.commons.io.FileUtils.deleteDirectory(getTestDirectory());
} finally {
/*
* Ensure to cleanup problematic symlink or "mvn clean" will fail
Expand All @@ -1548,7 +1548,7 @@ void deleteDirectoryWithDanglingSymlink() throws Exception {
File symlink = new File(getTestDirectory(), "danglingSymlink");
createSymlink(symlink, symlinkTarget);
try {
FileUtils.deleteDirectory(getTestDirectory());
org.apache.commons.io.FileUtils.deleteDirectory(getTestDirectory());
} finally {
/*
* Ensure to cleanup problematic symlink or "mvn clean" will fail
Expand Down
Loading