Examples of URLDownload


Examples of net.sf.jabref.net.URLDownload

        File temp = null;
        try {
            temp = File.createTempFile("jabref-link", "."+fileType.getExtension());
            temp.deleteOnExit();
            System.out.println("Downloading to '"+temp.getPath()+"'");
            URLDownload ud = new URLDownload(null, new URL(link), temp);
            ud.download();
            System.out.println("Done");
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
View Full Code Here

Examples of net.sf.jabref.net.URLDownload

    tmpfile.deleteOnExit();

    // System.out.println("Import url: " + dropLink.toString());
    // System.out.println("Temp file: "+tmpfile.getAbsolutePath());

    new URLDownload(entryTable, dropLink, tmpfile).download();

    // Import into new if entryTable==null, otherwise into current database:
    ImportMenuItem importer = new ImportMenuItem(frame, (entryTable == null));
    importer.automatedImport(new String[] { tmpfile.getAbsolutePath() });
View Full Code Here

Examples of net.sf.jabref.net.URLDownload

     *                 is complete.
     */
    public void download(URL url, final DownloadCallback callback) throws IOException {

        String res = url.toString();
        URLDownload udl = null;

        // First of all, start the download itself in the background to a temporary file:
        final File tmp = File.createTempFile("jabref_download", "tmp");
        tmp.deleteOnExit();
        //long time = System.currentTimeMillis();
        try {
            udl = new URLDownload(frame, url, tmp);
            // TODO: what if this takes long time?
            // TODO: stop editor dialog if this results in an error:
            udl.openConnectionOnly(); // Read MIME type
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(frame, Globals.lang("Invalid URL")+": "
                    + ex.getMessage(), Globals.lang("Download file"),
                    JOptionPane.ERROR_MESSAGE);
            Globals.logger("Error while downloading " + "'" + res + "'");
            return;
        }
        final URL urlF = url;
        final URLDownload udlF = udl;
        //System.out.println("Time: "+(System.currentTimeMillis()-time));
        (new Thread() {
            public void run() {

                try {
                    udlF.download();
                } catch (IOException e2) {
                    dontShowDialog = true;
                    if ((editor != null) && (editor.isVisible()))
                        editor.setVisible(false, false);
                    JOptionPane.showMessageDialog(frame, Globals.lang("Invalid URL")+": "
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

  }

  public void download(URL source) {
    this.source = source;
   
    new URLDownload(source, this, null).startDownload();
  }
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

 
  public MapTileXML() {
  }

  public void download(URL source) {
    new URLDownload(source, this, null).startDownload();
  }
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

   */
  public void download() {
    for(Connection conn : getConnectionList().getConnections()) {
      if (conn instanceof ConnectionURL) {
        try {
          new URLDownload(new URL(getSource(), ((ConnectionURL) conn).getUrl()), this, null).startDownload();
          break;
        } catch (MalformedURLException e) {
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

  public ServiceList() {
  }

  public void download(URL source) {
    setSource(source);
    new URLDownload(source, this, null).startDownload();
  }
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

 
  public ServerList() {
  }

  public void download(URL source) {
    new URLDownload(source, this, null).startDownload();
  }
View Full Code Here

Examples of org.earth3d.jearth.network.URLDownload

  public void download() {
    // download texture
    for(Connection conn : getTextureConnections().getConnections()) {
      if (conn instanceof ConnectionURL) {
        try {
          new URLDownload(new URL(getSource(), ((ConnectionURL) conn).getUrl()), this, DownloadType.TEXTURE).startDownload();
          break;
        } catch (MalformedURLException e) {
          e.printStackTrace();
        }
      }
    }

    // download heightfield
    for(Connection conn : getHeightfieldConnections().getConnections()) {
      if (conn instanceof ConnectionURL) {
        try {
          new URLDownload(new URL(getSource(), ((ConnectionURL) conn).getUrl()), this, DownloadType.HEIGHTFIELD).startDownload();
          break;
        } catch (MalformedURLException e) {
          e.printStackTrace();
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.