Package net.sourceforge.fullsync.fs

Examples of net.sourceforge.fullsync.fs.Site


      else {
        throw new URISyntaxException(url.toString(), "Not a valid uri or unknown scheme");
      }
    }

    Site s = fs.createConnection(desc);

    String bufferStrategy = desc.getParameter("bufferStrategy");

    if ((null != bufferStrategy) && !"".equals(bufferStrategy)) {
      s = resolveBuffering(s, bufferStrategy);
View Full Code Here


  /**
   * onBrowse
   * 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);
      foc.setSelectedFileObject(base);
      if (foc.open()) {
        URI uri;
        uri = new URI(foc.getActiveFileObject().getName().getURI());
        setPath(uri.getPath());
      }
    }
    catch (Exception e1) {
      ExceptionHandler.reportException(e1);
    }
    finally {
      if (null != conn) {
        try {
          conn.close();
        }
        catch (IOException e1) {
          e1.printStackTrace();
        }
      }
View Full Code Here

    return actionDecider;
  }

  @Override
  public TaskTree execute(Profile profile, boolean interactive) throws FileSystemException, URISyntaxException, DataParseException, IOException {
    Site d1 = null, d2 = null;

    RuleSet rules = profile.getRuleSet().createRuleSet();

    ActionDecider actionDecider;
    if (profile.getSynchronizationType().equals("Publish/Update")) {
      actionDecider = new PublishActionDecider();
    }
    else if (profile.getSynchronizationType().equals("Publish/Update Overwrite")) {
      actionDecider = new PublishOverwriteActionDecider();
    }
    else if (profile.getSynchronizationType().equals("Backup Copy")) {
      actionDecider = new BackupActionDecider();
    }
    else if (profile.getSynchronizationType().equals("Exact Copy")) {
      actionDecider = new ExactCopyActionDecider();
    }
    else if (profile.getSynchronizationType().equals("Two Way Sync")) {
      actionDecider = new TwoWaySyncActionDecider();
    }
    else {
      throw new IllegalArgumentException("Profile has unknown synchronization type.");
    }

    try {
      ConnectionDescription srcDesc = profile.getSource();
      ConnectionDescription dstDesc = profile.getDestination();
      if (interactive) {
        srcDesc.setParameter("interactive", "true");
        dstDesc.setParameter("interactive", "true");
      }
      d1 = fsm.createConnection(srcDesc);
      d2 = fsm.createConnection(dstDesc);
      return execute(d1, d2, actionDecider, rules);
    }
    catch (FileSystemException ex) {
      if (d1 != null) {
        d1.close();
      }
      if (d2 != null) {
        d2.close();
      }
      throw ex;
View Full Code Here

TOP

Related Classes of net.sourceforge.fullsync.fs.Site

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.