public static void updateForFile(File file){
  if (file != null) {
    File directory=file.getParentFile();
    update(directory);
  }
}

public static void updateForFile ( File file ) { if ( file != null ) { File directory = file . getParentFile ( ) ; update ( directory ) ; } }
update currentdirectory based on the supplied file . if the file exists then its parent is used .
