draeger-lab / ModelPolisher

ModelPolisher accesses the BiGG Models knowledgebase to annotate SBML models.
MIT License
23 stars 7 forks source link

fix #71 #73

Closed codekaust closed 5 years ago

codekaust commented 5 years ago

Just a quick comment:

 /**
   * @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

mephenor commented 5 years ago

Ok, for a directory that is going to be created and does not yet exist, this makes more sense. I'll merge the changes