private void repopulateList() { model.clear(); ReferenceSubstitution ref = new ReferenceSubstitution(); ref.add("path", EnvVars.getAppDir("minecraft_mineager")); File modDirectory = new File(ref.apply(Reference.directory.mods)); modDirectory.mkdirs(); for (File file : FileUtils.listFiles(modDirectory, new String[] {"zip"}, false)) model.addElement(file); }
private void jButton4(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton4 if (progress.isVisible()) return; JFileChooser jfc = new JFileChooser(); jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); jfc.setFileFilter(new ExtensionFileFilter("Zip Archive", new String[] {"zip"})); jfc.setAcceptAllFileFilterUsed(false); jfc.setMultiSelectionEnabled(true); jfc.showOpenDialog(null); ReferenceSubstitution ref = new ReferenceSubstitution(); ref.add("path", EnvVars.getAppDir("minecraft_mineager")); for (File file : jfc.getSelectedFiles()) if (file.renameTo(new File(ref.apply(Reference.directory.mods), file.getName()))) model.addElement(file); } // GEN-LAST:event_jButton4
@Override protected Void doInBackground() throws Exception { this.publish("init"); ReferenceSubstitution ref = new ReferenceSubstitution(); ref.add("path", EnvVars.getAppDir("minecraft_mineager")); Session session = new Session(ref.apply(Reference.file.session_json)); ref.add("version", session.getLoaded()); File clean = new File(ref.apply(Reference.file.base_clean_jar)); if (!clean.exists()) FileUtils.copyFile(new File(ref.apply(Reference.file.base_jar)), clean); List<File> toJoin = new ArrayList<>(); toJoin.add(clean); toJoin.addAll(jList1.getSelectedValuesList()); JoinZips jz = new JoinZips(toJoin, new File(ref.apply(Reference.file.base_jar)), progress); jz.execute(); jz.get(); return null; }