Package ch.ethz.ssh2

Examples of ch.ethz.ssh2.Version


    sendMessage(Packet.SSH_FXP_OPEN, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);

    int t = tr.readByte();

    int rep_id = tr.readUINT32();
    if (rep_id != req_id)
      throw new IOException("The server sent an invalid id field.");

    if (t == Packet.SSH_FXP_HANDLE)
    {
      if (debug != null)
      {
        debug.println("Got SSH_FXP_HANDLE.");
        debug.flush();
      }

      return new SFTPv3FileHandle(this, tr.readByteString());
    }

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();
    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }
View Full Code Here


    sendMessage(Packet.SSH_FXP_READ, req_id, tw.getBytes());

    byte[] resp = receiveMessage(34000);

    TypesReader tr = new TypesReader(resp);

    int t = tr.readByte();

    int rep_id = tr.readUINT32();
    if (rep_id != req_id)
      throw new IOException("The server sent an invalid id field.");

    if (t == Packet.SSH_FXP_DATA)
    {
      if (debug != null)
      {
        debug.println("Got SSH_FXP_DATA...");
        debug.flush();
      }

      int readLen = tr.readUINT32();

      if ((readLen < 0) || (readLen > len))
        throw new IOException("The server sent an invalid length field.");

      tr.readBytes(dst, dstoff, readLen);

      return readLen;
    }

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();

    if (errorCode == ErrorCodes.SSH_FX_EOF)
    {
      if (debug != null)
      {
        debug.println("Got SSH_FX_EOF.");
        debug.flush();
      }

      return -1;
    }

    String errorMessage = tr.readString();

    throw new SFTPException(errorMessage, errorCode);
  }
View Full Code Here

        srcoff += writeRequestLen;
        len -= writeRequestLen;

        byte[] resp = receiveMessage(34000);

        TypesReader tr = new TypesReader(resp);

        int t = tr.readByte();

        int rep_id = tr.readUINT32();
        if (rep_id != req_id)
          throw new IOException("The server sent an invalid id field.");

        if (t != Packet.SSH_FXP_STATUS)
          throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

        int errorCode = tr.readUINT32();

        if (errorCode == ErrorCodes.SSH_FX_OK)
          continue;

        String errorMessage = tr.readString();

        throw new SFTPException(errorMessage, errorCode);
      }
  }
View Full Code Here

    }

    @Override
    public boolean isFeatureSupported(String featureID) {
        if (featureID.equals(FEATURE_SCHEMADEFINITION)) {           
            Version version = VersionCompliance.toWGAVersion(getVersionCompliance());
            return (version != null && version.isAtLeast(5, 2)) || (getSchemaDefinitionFile() != null && getSchemaDefinitionFile().exists());
        }
        return super.isFeatureSupported(featureID);
    }
View Full Code Here

  public String getName() {
    return "Deployment [" + _deployment.getName() + "]";
  }

  public String[] getDependencies() {
    Version version = _deployment.getWGAVersion();
    if (version != null) {
      if (version.isAtLeast(5, 0)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(4, 1)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(4, 0)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_4};
      } else if (version.isAtLeast(3, 3)) {
        return new String[] {WGADesignerPlugin.LIBRARY_SET_J2EE_1_3};
      }
    }   
    return null;
  }
View Full Code Here

          while (it.hasNext()) {
            TMLTag tag = it.next();
            proposals.addAll(createTagProposals(alreadyTyped, tag, _document, _cursorAbsolute,activeFile));
          }
        } else {
          Version wgaVersion = (Version) WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(WGADesignStructureHelper.getWGAVersionCompliance(activeFile).getKey())
          if (wgaVersion.isAtLeast(4, 1)) {
            proposals.addAll(createIncludeModuleProposals(alreadyTyped, _document, _cursorAbsolute, activeFile));
          }
        }
      }     
    } else if (!isCursorInAttributeValue()) {
View Full Code Here

 
  public static VersionCompliance wgaVersionToVersionCompliance(Version version){     
      if(version!=null){
          Set<String> keySet = WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.keySet();
          for(String currentKey : keySet){
              Version currentVersion = (Version)WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(currentKey);
              if(currentVersion.getMajorVersion() == version.getMajorVersion() && currentVersion.getMinorVersion() == version.getMinorVersion()){
                  return WGADesignConfigurationModel.VERSIONCOMPLIANCES.get(currentKey);           
              }             
          }     
      }     
      return null;
View Full Code Here

    _versionCompliance = versionCompliance;
 

  protected boolean wgaVersionIsAtLeast(int major, int minor) {
    if (_versionCompliance != null) {
      Version wgaVersion = (Version) WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(_versionCompliance.getKey());
      return wgaVersion.isAtLeast(major, minor);
    }
    return false;
  }
View Full Code Here

 
  private static String retrieveTagInfoURL(String tagname, VersionCompliance versionCompliance) {
      StringBuffer url = new StringBuffer();
      url.append(TAG_INFO_URL);
      url.append("&tag=" + tagname);
      Version version = VersionCompliance.toWGAVersion(versionCompliance);
        if (version != null) {
            url.append("&version=" +  Integer.toString(version.getMajorVersion()) + Integer.toString(version.getMinorVersion()));
        }
      return url.toString();
  }
View Full Code Here

      url.append("&tag=" + tagname);
      url.append("&attribute=" + attribute);
      if (value != null) {
          url.append("&value=" + value);
      }
      Version version = VersionCompliance.toWGAVersion(versionCompliance);
      if (version != null) {
          url.append("&version=" +  Integer.toString(version.getMajorVersion()) + Integer.toString(version.getMinorVersion()));
      }
      return url.toString();
  }
View Full Code Here

TOP

Related Classes of ch.ethz.ssh2.Version

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.