Пример #1
0
  public boolean load() throws IOException {

    progs = new Vector<Program>();

    YamlReader reader = null;
    try {
      URL url2 = new URL(url + "/apps.yaml");
      HttpURLConnection conn = (HttpURLConnection) url2.openConnection();
      reader = new YamlReader(new InputStreamReader(conn.getInputStream()));
    } catch (IOException e) {
      e.printStackTrace();
    }

    appList = reader.read(AppList.class);

    for (String pckg : appList.getApps()) {
      System.out.println(pckg);
      Program prog = YamlLoader.loadAppFromUrl(url + "/" + pckg + "/cloudgene.yaml");
      // update url
      prog.setSource(url + "/" + pckg);
      progs.add(prog);
    }

    return true;
  }
Пример #2
0
 public static boolean checkBrowser() {
   AppList appList = MimeTypesList.getAppList();
   String bpath = appList.getBrowserExec();
   if (bpath != null) if (new File(bpath).isFile()) return true;
   JFileChooser chooser = new JFileChooser();
   chooser.setFileHidingEnabled(false);
   chooser.setDialogTitle(Local.getString("Select the web-browser executable"));
   chooser.setAcceptAllFileFilterUsed(true);
   chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
   /*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
   if (lastSel != null)
       chooser.setCurrentDirectory(lastSel);*/
   if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION) return false;
   appList.setBrowserExec(chooser.getSelectedFile().getPath());
   CurrentStorage.get().storeMimeTypesList();
   return true;
 }