
DevOps
-
create folder on the fly
public static void report_folders()
{
mkdir_by_path(ReportFilePath);
mkdir_by_path(ReportImagePath);
mkdir_by_path(PDfPath);
}
public static void mkdir_by_path(String path)
{
File theDir = new File(path);
// if the directory does not exist, create it
if (!theDir.exists()) {
System.out.println("creating directory: " + theDir.getName());
boolean result = false;
try{
theDir.mkdir();
result = true;
}
catch(SecurityException se){
//handle it
}
if(result) {
System.out.println("DIR created");
}
}
}
-
relative path
public static String ReportFilePath=System.getProperty("user.dir")+ "\\report\\";