Esempio n. 1
0
 /* (non-Javadoc)
  * @see com.aptana.ide.core.io.ConnectionPoint#saveState(com.aptana.ide.core.io.epl.IMemento)
  */
 @Override
 protected void saveState(IMemento memento) {
   super.saveState(memento);
   memento.createChild(ELEMENT_HOST).putTextData(host);
   if (IFTPSConstants.FTP_PORT_DEFAULT != port) {
     memento.createChild(ELEMENT_PORT).putTextData(Integer.toString(port));
   }
   if (!Path.ROOT.equals(path)) {
     memento.createChild(ELEMENT_PATH).putTextData(path.toPortableString());
   }
   if (login.length() != 0) {
     memento.createChild(ELEMENT_LOGIN).putTextData(login);
   }
   memento.createChild(ELEMENT_EXPLICIT).putTextData(Boolean.toString(explicit));
   memento
       .createChild(ELEMENT_VALIDATE_CERTIFICATE)
       .putTextData(Boolean.toString(validateCertificate));
   if (noSSLSessionResumption) {
     memento
         .createChild(ELEMENT_NO_SSL_SESSION_RESUMPTION)
         .putTextData(Boolean.toString(noSSLSessionResumption));
   }
   memento.createChild(ELEMENT_PASSIVE).putTextData(Boolean.toString(passiveMode));
   if (!IFTPSConstants.TRANSFER_TYPE_AUTO.equals(transferType)) {
     memento.createChild(ELEMENT_TRANSFER_TYPE).putTextData(transferType);
   }
   if (!IFTPSConstants.ENCODING_DEFAULT.equals(encoding)) {
     memento.createChild(ELEMENT_ENCODING).putTextData(encoding);
   }
   if (timezone != null && timezone.length() != 0) {
     memento.createChild(ELEMENT_TIMEZONE).putTextData(timezone);
   }
 }
Esempio n. 2
0
 /* (non-Javadoc)
  * @see com.aptana.ide.core.io.ConnectionPoint#loadState(com.aptana.ide.core.io.epl.IMemento)
  */
 @Override
 protected void loadState(IMemento memento) {
   super.loadState(memento);
   IMemento child = memento.getChild(ELEMENT_HOST);
   if (child != null) {
     host = child.getTextData();
   }
   child = memento.getChild(ELEMENT_PORT);
   if (child != null) {
     try {
       port = Integer.parseInt(child.getTextData());
     } catch (NumberFormatException e) {
     }
   }
   child = memento.getChild(ELEMENT_PATH);
   if (child != null) {
     String text = child.getTextData();
     if (text != null) {
       path = Path.fromPortableString(text);
     }
   }
   child = memento.getChild(ELEMENT_LOGIN);
   if (child != null) {
     login = child.getTextData();
   }
   child = memento.getChild(ELEMENT_EXPLICIT);
   if (child != null) {
     explicit = Boolean.parseBoolean(child.getTextData());
   }
   child = memento.getChild(ELEMENT_VALIDATE_CERTIFICATE);
   if (child != null) {
     validateCertificate = Boolean.parseBoolean(child.getTextData());
   }
   child = memento.getChild(ELEMENT_NO_SSL_SESSION_RESUMPTION);
   if (child != null) {
     noSSLSessionResumption = Boolean.parseBoolean(child.getTextData());
   }
   child = memento.getChild(ELEMENT_PASSIVE);
   if (child != null) {
     passiveMode = Boolean.parseBoolean(child.getTextData());
   }
   child = memento.getChild(ELEMENT_TRANSFER_TYPE);
   if (child != null) {
     transferType = child.getTextData();
   }
   child = memento.getChild(ELEMENT_ENCODING);
   if (child != null) {
     encoding = child.getTextData();
   }
   child = memento.getChild(ELEMENT_TIMEZONE);
   if (child != null) {
     timezone = child.getTextData();
   }
 }
Esempio n. 3
0
 /*
  * (non-Javadoc)
  * @see com.aptana.ide.core.io.ConnectionPoint#connect(boolean, org.eclipse.core.runtime.IProgressMonitor)
  */
 @Override
 public void connect(boolean force, IProgressMonitor monitor) throws CoreException {
   if (!force && isConnected()) {
     return;
   }
   ConnectionContext context = CoreIOPlugin.getConnectionContext(this);
   if (context != null) {
     CoreIOPlugin.setConnectionContext(connectionFileManager, context);
   }
   getConnectionFileManager().connect(monitor);
   super.connect(force, monitor);
 }
Esempio n. 4
0
 /*
  * (non-Javadoc)
  * @see com.aptana.ide.core.io.ConnectionPoint#loadState(com.aptana.ide.core.io.epl.IMemento)
  */
 @Override
 protected void loadState(IMemento memento) {
   super.loadState(memento);
   IMemento child = memento.getChild(ELEMENT_HOST);
   if (child != null) {
     host = child.getTextData();
   }
   child = memento.getChild(ELEMENT_PORT);
   if (child != null) {
     try {
       port = Integer.parseInt(child.getTextData());
     } catch (NumberFormatException e) {
     }
   }
   child = memento.getChild(ELEMENT_PATH);
   if (child != null) {
     String text = child.getTextData();
     if (text != null) {
       path = Path.fromPortableString(text);
     }
   }
   child = memento.getChild(ELEMENT_LOGIN);
   if (child != null) {
     login = child.getTextData();
   }
   child = memento.getChild(ELEMENT_PASSIVE);
   if (child != null) {
     passiveMode = Boolean.parseBoolean(child.getTextData());
   }
   child = memento.getChild(ELEMENT_TRANSFER_TYPE);
   if (child != null) {
     transferType = child.getTextData();
   }
   child = memento.getChild(ELEMENT_ENCODING);
   if (child != null) {
     encoding = child.getTextData();
   }
   child = memento.getChild(ELEMENT_TIMEZONE);
   if (child != null) {
     timezone = child.getTextData();
   }
 }
Esempio n. 5
0
 /*
  * (non-Javadoc)
  * @see com.aptana.ide.core.io.ConnectionPoint#saveState(com.aptana.ide.core.io.epl.IMemento)
  */
 @Override
 protected void saveState(IMemento memento) {
   super.saveState(memento);
   memento.createChild(ELEMENT_HOST).putTextData(host);
   if (IFTPConstants.FTP_PORT_DEFAULT != port) {
     memento.createChild(ELEMENT_PORT).putTextData(Integer.toString(port));
   }
   if (!Path.ROOT.equals(path)) {
     memento.createChild(ELEMENT_PATH).putTextData(path.toPortableString());
   }
   if (login.length() != 0) {
     memento.createChild(ELEMENT_LOGIN).putTextData(login);
   }
   memento.createChild(ELEMENT_PASSIVE).putTextData(Boolean.toString(passiveMode));
   if (!IFTPConstants.TRANSFER_TYPE_AUTO.equals(transferType)) {
     memento.createChild(ELEMENT_TRANSFER_TYPE).putTextData(transferType);
   }
   if (!IFTPConstants.ENCODING_DEFAULT.equals(encoding)) {
     memento.createChild(ELEMENT_ENCODING).putTextData(encoding);
   }
   if (timezone != null && timezone.length() != 0) {
     memento.createChild(ELEMENT_TIMEZONE).putTextData(timezone);
   }
 }