mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 16:36:15 +00:00
Merge pull request #1096 from sidheshenator/FileUtil_Sanity_Check
sanity check added to FileUtil.deleteDir()
This commit is contained in:
commit
2c7fb17a19
@ -38,7 +38,10 @@ import org.openide.filesystems.FileObject;
|
|||||||
* @return true if the dir deleted, false otherwise
|
* @return true if the dir deleted, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean deleteDir(File dirPath) {
|
public static boolean deleteDir(File dirPath) {
|
||||||
if (dirPath.exists()) {
|
if(dirPath.isFile())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (dirPath.isDirectory() && dirPath.exists()) {
|
||||||
File[] files = dirPath.listFiles();
|
File[] files = dirPath.listFiles();
|
||||||
for (int i = 0; i < files.length; i++) {
|
for (int i = 0; i < files.length; i++) {
|
||||||
if (files[i].isDirectory()) {
|
if (files[i].isDirectory()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user