com.idrsolutions.microservice.utils.FileHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of base-microservice-example Show documentation
Show all versions of base-microservice-example Show documentation
Provides the shared classes used by IDRsolutions microservice examples.
package com.idrsolutions.microservice.utils;
import java.io.File;
public class FileHelper {
/**
* Delete a folder and all of its contents.
*
* @param dirPath the path to the folder to delete
*/
public static void deleteFolder(final File dirPath) {
final File[] files = dirPath.listFiles();
if (files != null) {
for (final File file : files) {
if (file.isDirectory()) {
deleteFolder(file);
}
file.delete();
}
}
dirPath.delete();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy