private Pair<Boolean,String> isOnLocal(URL url){
  File dir=new File("CoursePickerData");
  if (!dir.exists()) {
    dir.mkdir();
  }
  String filename=url.getFile();
  int index=filename.lastIndexOf("/");
  String localFileName=filename.substring(index + 1,filename.length() - 4) + ".txt";
  File localFile=new File(dir + "/" + localFileName);
  return new Pair<>(localFile.exists() && localFile.isFile(),localFile.getAbsolutePath());
}

private Pair < Boolean , String > isOnLocal ( URL url ) { File dir = new File ( "CoursePickerData" ) ; if ( ! dir . exists ( ) ) { dir . mkdir ( ) ; } String filename = url . getFile ( ) ; int index = filename . lastIndexOf ( "/" ) ; String localFileName = filename . substring ( index + 1 , filename . length ( ) - 4 ) + ".txt" ; File localFile = new File ( dir + "/" + localFileName ) ; return new Pair < > ( localFile . exists ( ) && localFile . isFile ( ) , localFile . getAbsolutePath ( ) ) ; }
check if the file is already on local machine
