String source = "";
if (System.getProperties().getProperty("os.name").toUpperCase().contains("WINDOWS")){
File[] roots = File.listRoots();
if (roots.length>0){
source=roots[0].toString().replaceAll("\\\\","/")+"sitemap/";
}
}else {
source="/home/sitemap/";
}
File file = new File(source);
if (!file.exists()) {
file.mkdir();
}