Пример #1
0
 private Thread ripAlbum(String urlString) {
   URL url = null;
   try {
     url = new URL(urlString);
   } catch (MalformedURLException e) {
     logger.error("[!] Could not generate URL for '" + urlString + "'", e);
     status("Error: " + e.getMessage());
     return null;
   }
   ripButton.setEnabled(false);
   ripTextfield.setEnabled(false);
   statusProgress.setValue(100);
   openButton.setVisible(false);
   statusLabel.setVisible(true);
   mainFrame.pack();
   try {
     AbstractRipper ripper = AbstractRipper.getRipper(url);
     ripTextfield.setText(ripper.getURL().toExternalForm());
     ripper.setObserver((RipStatusHandler) this);
     Thread t = new Thread(ripper);
     t.start();
     return t;
   } catch (Exception e) {
     logger.error("[!] Error while ripping: " + e.getMessage(), e);
     status("Error: " + e.getMessage());
     ripButton.setEnabled(true);
     ripTextfield.setEnabled(true);
     statusProgress.setValue(0);
     mainFrame.pack();
     return null;
   }
 }
Пример #2
0
 public static void rip(URL url) throws Exception {
   AbstractRipper ripper = AbstractRipper.getRipper(url);
   ripper.setup();
   ripper.rip();
 }