forked from loafle/openapi-generator-original
Swagr codegen: Adding checks to confirm folder is present for clearing older generated files
This commit is contained in:
parent
10ffad369c
commit
70529845fb
@ -63,10 +63,12 @@ public class FileUtil {
|
|||||||
public static void clearFolder(String directoryLocation) {
|
public static void clearFolder(String directoryLocation) {
|
||||||
File fDir = new File(directoryLocation);
|
File fDir = new File(directoryLocation);
|
||||||
File[] files = fDir.listFiles();
|
File[] files = fDir.listFiles();
|
||||||
|
if(files != null){
|
||||||
for(File aFile : files) {
|
for(File aFile : files) {
|
||||||
aFile.delete();
|
aFile.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clears the folder of the files with extension
|
// Clears the folder of the files with extension
|
||||||
public static void clearFolder(String strFolder, final String strExt) {
|
public static void clearFolder(String strFolder, final String strExt) {
|
||||||
@ -77,10 +79,12 @@ public class FileUtil {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (fLogs != null) {
|
||||||
for (int i = 0; i < fLogs.length; i++) {
|
for (int i = 0; i < fLogs.length; i++) {
|
||||||
deleteFile(fLogs[i].getAbsolutePath());
|
deleteFile(fLogs[i].getAbsolutePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void copyDirectory(File srcPath, File dstPath) {
|
public static void copyDirectory(File srcPath, File dstPath) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user