Example #1
0
  private int getMaxOrderByPath(String urlOrPath, boolean local) {
    for (int n = 25; n >= 1; n--) {
      if (local && new File(urlOrPath + Util.FS + "Norder" + n).isDirectory()
          || !local && Util.isUrlResponding(urlOrPath + "/Norder" + n)) return n;
    }
    return -1;

    //      int maxOrder=-1;
    //      for( int n=3; n<100; n++ ) {
    //         if( local && !(new File(urlOrPath+Util.FS+"Norder"+n).isDirectory()) ||
    //            !local && !Util.isUrlResponding(urlOrPath+"/Norder"+n)) break;
    //         maxOrder=n;
    //      }
    //      return maxOrder;
  }
Example #2
0
 private boolean getFormatByPath(String path, boolean local, int fmt) {
   String ext = fmt == 0 ? ".fits" : fmt == 1 ? ".jpg" : fmt == 3 ? ".png" : ".xml";
   return local && (new File(path + Util.FS + "Norder3" + Util.FS + "Allsky" + ext)).exists()
       || !local && Util.isUrlResponding(path + "/Norder3/Allsky" + ext);
 }