/**
* @param file
*/
public boolean isDirectory(File file){
/*
file = d1/d2/d3 is taken as a file by method file.isDirectory()
Check if file is directory by checking presence or '.' in output.getName()
*/
return !file.getName().contains(".");
}```
there should be a method defined on file, that let's you check that directly, no need for a helper function there, file.isDirectory(), if I am not mistaken.
Please change that accordingly
This function has been added because java.io.File.isDirectory() function returns false even for output location = d1/d2/d3 considering d3 as a file in directory d1/d2.
Consider this example
--input = ./model.xml --output=<existing_directories>/d1/d2
d1 and d2 do not exist already
Now ModelPolisher should create directory d1/d2 rather than writing in a file named d2
This function has been added because
java.io.File.isDirectory()
function returnsfalse
even for output location =d1/d2/d3
consideringd3
as a file in directoryd1/d2
.Consider this example
--input = ./model.xml --output=<existing_directories>/d1/d2
d1 and d2 do not exist already Now ModelPolisher should create directory
d1/d2
rather than writing in a file named d2