I am working on a script to create sub-directories with names, that are fetched from a database. I am passing 2 parameters, for creating 2 directories, one inside the other. Code snippet is below.
File files = new File(name1+"\"+name2);
if (!files.exists()) {
if (files.mkdirs()) {
System.out.println("sub directories created successfully");
} else {
System.out.println("failed to create sub directories");
}
}
The "name2" parameter is of the format "abc/d/e" and this has to be the name of the directory. Using the above code, it create individual folders as abc,d,e. I am working on java & linux platform
Any solution for this.