Examples of GetMethod


Examples of com.buschmais.cdo.impl.proxy.query.property.GetMethod

            for (AnnotatedMethod typeMethod : typeMethodsOfType) {
                if (!(typeMethod instanceof GetPropertyMethod)) {
                    throw new CdoException("Only get methods are supported for projections: '" + typeMethod.getAnnotatedElement().getName() + "'.");
                }
                PropertyMethod propertyMethod = (PropertyMethod) typeMethod;
                GetMethod proxyMethod = new GetMethod(propertyMethod.getName(), propertyMethod.getType());
                addProxyMethod(proxyMethod, propertyMethod.getAnnotatedElement());
            }
        }
        addMethod(new AsMethod(), CompositeObject.class, "as", Class.class);
        addMethod(new GetDelegateMethod<Map<String, Object>>(), CompositeObject.class, "getDelegate");
View Full Code Here

Examples of com.buschmais.xo.impl.proxy.query.property.GetMethod

            for (AnnotatedMethod typeMethod : typeMethodsOfType) {
                if (!(typeMethod instanceof GetPropertyMethod)) {
                    throw new XOException("Only get methods are supported for projections: '" + typeMethod.getAnnotatedElement().getName() + "'.");
                }
                PropertyMethod propertyMethod = (PropertyMethod) typeMethod;
                GetMethod proxyMethod = new GetMethod(propertyMethod.getName(), propertyMethod.getType());
                addProxyMethod(proxyMethod, propertyMethod.getAnnotatedElement());
            }
        }
        addMethod(new AsMethod(), CompositeObject.class, "as", Class.class);
        addMethod(new GetDelegateMethod<Map<String, Object>>(), CompositeObject.class, "getDelegate");
View Full Code Here

Examples of com.dotcms.repackage.org.apache.commons.httpclient.methods.GetMethod

        notifyStartRequest();
        HttpMethodBase m;
        if (rangeList != null) {
            m = new RangedGetMethod(url, rangeList);
        } else {
            m = new GetMethod(url);
        }
        InputStream in = null;
        NotifyingFileInputStream nin = null;
        try {
            int res = client.executeMethod(m);
View Full Code Here

Examples of com.dyuproject.protostuff.model.PropertyAccessor.GetMethod

   
    public ReadOnlyProperty(PropertyMeta propertyMeta)
    {
        super(propertyMeta);
       
        _messageGet = new GetMethod();
        _builderGet = new GetMethod();
       
        if(propertyMeta.isRepeated())
        {
            _messageHas = new RepeatedHasMethod();
            _builderHas = new RepeatedHasMethod();               
View Full Code Here

Examples of com.ecyrd.jspwiki.dav.methods.GetMethod

       
        DavPath path = new DavPath( p );
       
        if( path.isRoot() )
        {
            DavMethod dm = new GetMethod( m_rootProvider );
            dm.execute( req, res, path );
        }
        else
        {
            DavMethod dm = new GetMethod( pickProvider(path.get(0)) );
       
            dm.execute( req, res, path.subPath(1) );
        }
    }
View Full Code Here

Examples of com.maverick.http.GetMethod

        // #ifdef DEBUG
        log.info("Registering with the server"); //$NON-NLS-1$
        log.info("Server is " + (isSecure ? "https://" : "http://") + getAditoHost() //$NON-NLS-1$
            + ":" + getAditoPort()); //$NON-NLS-1$
        // #endif
        GetMethod post = new GetMethod("/agent"); //$NON-NLS-1$

              client.setPreemtiveAuthentication(doPreemptive);
        if (!doPreemptive && ticket != null) {
          post.setParameter("ticket", ticket); //$NON-NLS-1$
        }

        post.setParameter(
            "agentType", getConfiguration().getAgentType()); //$NON-NLS-1$ //$NON-NLS-2$
        post.setParameter("locale", Locale.getDefault().toString()); //$NON-NLS-1$

        response = client.execute(post);

        if (response.getStatus() == 302) {
          // Reset the client
          this.client = null;

          URL url = new URL(response.getHeaderField("Location")); //$NON-NLS-1$
          aditoHostname = url.getHost();
          if (url.getPort() > 0)
            aditoPort = url.getPort();
          continue;
        } else if (response.getStatus() == 200) {
          con.addListener(this);
          httpConnection = response.getConnection(); // Preserve the
          // connection
          con.registerRequestHandler(MESSAGE_REQUEST, this);
          con.registerRequestHandler(SHUTDOWN_REQUEST, this);
          con.registerRequestHandler(OPEN_URL_REQUEST, this);
          con.registerRequestHandler(UPDATE_RESOURCES_REQUEST, this);

          // Start the protocol

          con.startProtocol(
              response.getConnection().getInputStream(), response
                  .getConnection().getOutputStream(), true);

          // Synchronize and read back server information
          Request syncRequest = new Request(SYNCHRONIZED_REQUEST);
          con.sendRequest(syncRequest, true);
          if (syncRequest.getRequestData() == null)
            throw new IOException(
                "Server failed to return version data");

          ByteArrayReader reader = new ByteArrayReader(syncRequest
              .getRequestData());
          serverVersion = reader.readString();

          /**
           * Initialize the managers. Tunnels are no longer recorded
           * here unless they are active. This simplifies the agent by
           * making it respond to start and stop requests from the new
           * persistent connection with Adito.
           */
          tunnelManager = new TunnelManager(this);
          applicationManager = new ApplicationManager(this);
          webForwardManager = new WebForwardManager(this);
          networkPlaceManager = new NetworkPlaceManager(this);
          updateResources(-1);
          return;
        } else if (response.getStatus() == 401) {
          authenticator = HttpAuthenticatorFactory
              .createAuthenticator(
                  response.getConnection(),
                  response
                      .getHeaderFields("WWW-Authenticate"),
                  "WWW-Authenticate", "Authorization",
                  HttpAuthenticatorFactory.BASIC, post
                      .getURI());
          if (authenticator.wantsPrompt()) {
            if ( !( defaultAuthenticationPrompt != null ? defaultAuthenticationPrompt.promptForCredentials(false, authenticator) :
                getGUI().promptForCredentials(false, authenticator) ) ) {
              throw new AuthenticationCancelledException();
View Full Code Here

Examples of com.sola.instagram.io.GetMethod

   */
  public User getUserById(int userId) throws Exception {
    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("user_id", userId);
    String uri = uriConstructor.constructUri(UriFactory.Users.GET_DATA, map, true);
    JSONObject userObject = (new GetMethod(uri).call()).getJSON();
    if (userObject.has("data")) {
      return new User(userObject.getJSONObject("data"), getAccessToken());
    } else {
      throw new InstagramException("User with id = " + userId
          + " cannot be accessed" + " or may not exist");
View Full Code Here

Examples of org.apache.commons.httpclient.methods.GetMethod

       HttpMethod theMethod = null;
       StringBuffer sb = new StringBuffer();

       if ("GET".equalsIgnoreCase(method)) {
           theMethod = new GetMethod(urlpath);
       } else if ("POST".equalsIgnoreCase(method)) {
           theMethod = new PostMethod(urlpath);
       }

       if (username != null && password != null) {
View Full Code Here

Examples of org.apache.commons.httpclient.methods.GetMethod

   */
  private static Channel fetchChannelViaHTTP(String url)
    throws HttpException, IOException, SAXException
  {
    Digester parser = new XMLDigester();
    GetMethod get = new GetMethod(url);
    //get.setRequestHeader("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; zh-cn) Opera 8.52");
        try {
          http_client.executeMethod(get);
          if(get.getStatusCode()==HttpServletResponse.SC_OK){
            Charset cs = null;
            Header header_cs = getResponseHeader(get,"Content-Type");
            if(header_cs==null){
              cs = Charset.forName(get.getResponseCharSet());
            }
            else{
              String content_type = header_cs.getValue().toLowerCase();
              try {
            Object[] values = content_type_parser.parse(content_type);
            cs = Charset.forName((String)values[1]);
          } catch (ParseException e) {
            URL o_url = new URL(url);
            String host = o_url.getHost();
            Iterator hosts = charsets.keySet().iterator();
            while(hosts.hasNext()){
              String t_host = (String)hosts.next();
              if(host.toLowerCase().endsWith(t_host)){
                cs = Charset.forName((String)charsets.get(t_host));
                break;
              }
            }
            if(cs==null)
              cs = default_charset;
           
          }
            }           
           
            BufferedReader rd = new BufferedReader(new InputStreamReader(
            get.getResponseBodyAsStream(), cs));
           
            char[] cbuf = new char[1];
            int read_idx = 1;
            do{
              rd.mark(read_idx++);
              if(rd.read(cbuf)==-1)
                break;
              if(cbuf[0]!='<')
                continue;
              rd.reset();
              break;
            }while(true);
            return (Channel)parser.parse(rd);
          }
          else{
            log.error("Fetch RSS from " + url + " failed, code="+get.getStatusCode());
          }
        }finally{
          get.releaseConnection();
        }
      return null;
  }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.GetMethod

    private String retrieveTagHelp() {
        if (_connectionErrors < MAX_CONNECTION_ERRORS) {
                StringBuffer information = new StringBuffer()
                try {
                    // build online help url
                    GetMethod getMethod = new GetMethod(retrieveTagInfoURL(_tagname, _versionCompliance));
                    int returnCode = _httpClient.executeMethod(getMethod);
                    if (returnCode == HttpsURLConnection.HTTP_OK) {
                        information.append(getMethod.getResponseBodyAsString());
                    }
                } catch (Exception e) {
                    Plugin.getDefault().logError("Unable to retrieve online help data.", e);
                    _connectionErrors ++;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.