Ejemplo n.º 1
0
  public DlgInfo(Frame frame, FTPThread tBrowse, String path, FileInfo fileInfo, Component c) {
    super(frame, fileInfo.getName() + " Info", false);
    LogManager.debug("Displaying info for: " + fileInfo.toString());

    this.fileInfo = fileInfo;
    this.path = path;
    this.tBrowse = tBrowse;

    try {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      slInit();
      //			jbInit();
      if (c == null) {
        locateDialog(frame);
      } else {
        setLocation(c.getX() + 25, c.getY() + 25);
      }
      setResizable(false);
      pack();
      treeDetailInfo.updateUI();
      setVisible(true);
      setFocusable(true);
      requestFocus();

    } catch (Exception ex) {
      LogManager.error("Failed to initialize the file info panel.", ex);
    }
  }
Ejemplo n.º 2
0
  protected void get(boolean passive, RestartData restart, String remoteFile)
      throws IOException, FTPException {
    InputStreamDataSink sink = null;

    try {
      this.ftp.setType(Session.TYPE_IMAGE);
      if (passive) {
        this.ftp.setPassive();
        this.ftp.setLocalActive();
      } else {
        this.ftp.setLocalPassive();
        this.ftp.setActive();
      }
      if (null != restart) {
        this.ftp.setRestartMarker(restart);
      }

      sink = new InputStreamDataSink();
      this.input = sink.getInputStream();
      this.state = this.ftp.asynchGet(remoteFile, sink, null);
      this.state.waitForStart();
    } catch (FTPException e) {
      if (sink != null) {
        sink.close();
      }
      close();
      LogManager.debug("Current thread with closed socket is: " + Thread.currentThread().getName());
      throw e;
    }
  }
Ejemplo n.º 3
0
  public long getSize() {
    long rep = -1;

    try {
      rep = this.ftp.getSize(this.targetFile);
    } catch (Exception e) {
      e.printStackTrace();
      org.teragrid.portal.filebrowser.applet.util.LogManager.debug(
          e.getLocalizedMessage() + " at " + (e.getStackTrace())[0]);
    }
    // System.out.println(rep+" is the size");
    return rep;
  }