Package net.sourceforge.fullsync

Examples of net.sourceforge.fullsync.ConnectionDescription


    super.createGUI(parent);
  }

  @Override
  public ConnectionDescription getConnectionDescription() throws URISyntaxException {
    ConnectionDescription loc = super.getConnectionDescription();
    loc.setUri(new URI(m_scheme, null, textHost.getText(), spinnerPort.getSelection(), loc.getUri().getPath(), null, null));
    loc.setParameter("username", textUsername.getText());
    loc.setSecretParameter("password", textPassword.getText());
    loc.setParameter("publicKeyAuth", buttonKeybased.getSelection() ? "enabled" : "disabled");
    loc.setSecretParameter("keyPassphrase", textKeyPassphrase.getText());
    return loc;
  }
View Full Code Here


  };

  @Override
  public ConnectionDescription getConnectionDescription() throws URISyntaxException {
    File f = new File(textPath.getText());
    return new ConnectionDescription(f.toURI());
  }
View Full Code Here

    return new ConnectionDescription(f.toURI());
  }

  @Override
  public void onBrowse() {
    ConnectionDescription desc = null;
    try {
      desc = getConnectionDescription();
    }
    catch (URISyntaxException e) {
      e.printStackTrace();
    }
    DirectoryDialog d = new DirectoryDialog(m_parent.getShell());
    if (null != desc) {
      d.setFilterPath(desc.getUri().getPath());
    }
    String dir = d.open();
    if (dir != null) {
      File f = new File(dir);
      try {
View Full Code Here

    setUserPasswordEnabled(comboAuthentication.getSelectionIndex() == 1);
  }

  @Override
  public ConnectionDescription getConnectionDescription() throws URISyntaxException {
    ConnectionDescription connection = super.getConnectionDescription();
    if (comboAuthentication.getSelectionIndex() == 0) {
      connection.setParameter(ConnectionDescription.PARAMETER_USERNAME, FTP_ANONYMOUS_USERNAME);
      connection.setSecretParameter(ConnectionDescription.PARAMETER_PASSWORD, "");
    }
    return connection;
  }
View Full Code Here

    return gridData1;
  }

  @Override
  public ConnectionDescription getConnectionDescription() throws URISyntaxException {
    ConnectionDescription desc = super.getConnectionDescription();
    if (null != spinnerPort) {
      desc.setUri(new URI(m_scheme, null, textHost.getText(), spinnerPort.getSelection(), desc.getUri().getPath(), null, null));
    }
    else {
      desc.setUri(new URI(m_scheme, textHost.getText(), desc.getUri().getPath(), null));
    }
    desc.setParameter(ConnectionDescription.PARAMETER_USERNAME, textUsername.getText());
    desc.setSecretParameter(ConnectionDescription.PARAMETER_PASSWORD, textPassword.getText());
    return desc;
  }
View Full Code Here

  public ConnectionDescription getConnectionDescription() throws URISyntaxException {
    String path = textPath.getText();
    if ((null == path) || (0 == path.length())) {
      path = "/";
    }
    return new ConnectionDescription(new URI(m_scheme, null, path, null));
  }
View Full Code Here

   * open a browse dialog and let the user choose a path.
   */
  public void onBrowse() {
    Site conn = null;
    try {
      ConnectionDescription desc = getConnectionDescription();
      FileSystemManager fsm = new FileSystemManager();
      desc.setParameter("interactive", "true");
      conn = fsm.createConnection(desc);

      FileObject base = conn.getBase();
      FileObjectChooser foc = new FileObjectChooser(m_parent.getShell(), SWT.NULL);
      foc.setBaseFileObject(base);
View Full Code Here

  @Override
  public boolean apply() {
    closeSourceSite();

    ConnectionDescription src, dst;
    try {
      src = getConnectionDescription(srcConnectionConfiguration);
      dst = getConnectionDescription(dstConnectionConfiguration);
    }
    catch (Exception e) {
View Full Code Here

    return true; //FIXME: return false if failed
  }


  private ConnectionDescription getConnectionDescription(final ConnectionConfiguration cfg) {
    ConnectionDescription dst = null;
    try {
      dst = cfg.getConnectionDescription();
      if (cfg.getBuffered()) {
        dst.setParameter("bufferStrategy", "syncfiles"); //$NON-NLS-1$
      }
    }
    catch (URISyntaxException e) {
    }
    return dst;
View Full Code Here

    return dst;
  }

  private void treeTabsWidgetSelected(SelectionEvent evt) {
    if (evt.item == tabSubDirs) {
      final ConnectionDescription src = getConnectionDescription(srcConnectionConfiguration);
      if ((sourceSite == null) || (src == null) || !src.getUri().toString().equals(lastSourceLoaded)) {
        directoryTree.removeAll();
        TreeItem loadingIem = new TreeItem(directoryTree, SWT.NULL);
        loadingIem.setText("Loading source dir...");
        loadingIem.setImage(GuiController.getInstance().getImage("Node_Directory.png"));

        Display display = Display.getCurrent();
        display.asyncExec(new Runnable() {
          @Override
          public void run() {
            try {
              if (null != src) {
                closeSourceSite();
                src.setParameter("bufferStrategy", ""); // the subdirs tab should bypass the buffer imo
                src.setParameter("interactive", "true");
                sourceSite = fsm.createConnection(src);
                drawDirectoryTree();
                lastSourceLoaded = src.getUri().toString();
              }
              else {
                TreeItem loadingIem = new TreeItem(directoryTree, SWT.NULL);
                loadingIem.setText("Unable to load source dir");
                loadingIem.setImage(GuiController.getInstance().getImage("Error.png"));
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.ConnectionDescription

Copyright © 2018 www.massapicom. 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.