code: protected boolean isDirectory(Resource directory) {
  	if (directory.exists()) return directory.isDirectory();
  	try {
  	    directory.createDirectory(true);
  	    return true;
  	}
  	catch (IOException e) {
  	    e.printStackTrace(getErrWriter());
  	}
  	return false;
      }
docs: is file a directory or not, touch if not exist
  
  @param directory
  @return true if existing directory or has created new one