-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed bugs related to deleting files in imagecopyfinder
- Loading branch information
1 parent
9f48203
commit 2c0185b
Showing
6 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package toolset; | ||
|
||
import sections.UserFeedback; | ||
|
||
import java.io.File; | ||
|
||
public final class FileManagementTools { | ||
|
||
public static void moveFile(File file, String deleteDirectory) { | ||
if (!new File(deleteDirectory).exists()) { | ||
new File(deleteDirectory).mkdir(); | ||
if (!new File(deleteDirectory).mkdir()) { | ||
UserFeedback.popup("Couldn't create directory"); | ||
return; | ||
} | ||
} | ||
String s = file.getName(); | ||
String localDeleteDirectory = deleteDirectory; | ||
localDeleteDirectory += s; | ||
file.renameTo(new File(localDeleteDirectory)); | ||
if (!file.renameTo(new File(localDeleteDirectory))) { | ||
UserFeedback.popup("Couldn't move file!"); | ||
} | ||
try { | ||
System.out.println(file.getCanonicalPath()); | ||
System.out.println(file.getName()); | ||
System.out.println("+++++"); | ||
} catch (Exception e) { | ||
// | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters