Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpPost.abort()


      // We presume that the data is utf-8, since that's what the API uses throughout.
      return responseString;
    }
    finally
    {
      method.abort();
    }
  }

  /** Perform a json GET API operation, using Configuration structures to represent the json.  This is for testing convenience,
  * mostly.
 
View Full Code Here


           
      inputStream_ = new ByteArrayInputStream(baos.toByteArray());
    } catch (IOException ioe) {
      // Abort method so the connection gets released back to the connection manager
      if (null != post) {
        post.abort();
      }
      throw new TTransportException(ioe);
    } finally {
      if (null != is) {
        // Close the entity's input stream, this will release the underlying connection
View Full Code Here

           
      inputStream_ = new ByteArrayInputStream(baos.toByteArray());
    } catch (IOException ioe) {
      // Abort method so the connection gets released back to the connection manager
      if (null != post) {
        post.abort();
      }
      throw new TTransportException(ioe);
    } finally {
      if (null != is) {
        // Close the entity's input stream, this will release the underlying connection
View Full Code Here

      while ((tempStr = input.readLine()) != null) {
        interfaceData += tempStr.replace("\t", "");
      }
    }
    // 关闭连接
    httpPost.abort();
   
    // 打印日志
    log.info("doPost返回的json数据:" + interfaceData);
   
    return interfaceData;
View Full Code Here

        } catch (IOException e) {
            return resultAsJsonNode(FAILURE, e.getMessage(), e, FALSE);
        } finally {
            if (httpPost != null) {
                // Release of httpclient resources
                httpPost.abort();
            }
            updateStatistics(requestStartTime, System.nanoTime());
        }
    }
View Full Code Here

        } catch (Exception e) {
            LOG.error(e);
            return null;
        } finally {
            // Release httpclient resources
            uploadRequest.abort();
            httpConnectionManager.shutdown();
            // Delete cache file
            deleteCacheFile();
        }
    }
View Full Code Here

            // notify user that file has been uploaded
            notification.finished();
        } catch( Exception e ) {
            Log.e(TAG, "exception: " + url, e);
            // file upload failed so abort post and close connection
            post.abort();
            client.getConnectionManager().shutdown();

            // get user preferences and number of retries for failed upload
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( context );
            int maxRetries = Integer.valueOf( prefs.getString( "retries", "" ).substring( 1 ) );
View Full Code Here

      // We presume that the data is utf-8, since that's what the API uses throughout.
      return responseString;
    }
    finally
    {
      method.abort();
    }
  }

  /** Perform a json GET API operation, using Configuration structures to represent the json.  This is for testing convenience,
  * mostly.
 
View Full Code Here

            //logger.debug("storageURL: " + getStorageURL());
            logger.debug("authToken: " + authToken);
            //logger.debug("cdnManagementURL:" + getCdnManagementURL());
            logger.debug("ConnectionManager:" + client.getConnectionManager());
        }
        method.abort();

        return this.isLoggedin;
    }
   
View Full Code Here

              method.setHeader(FilesConstants.X_CDN_USER_AGENT_ACL, userAgentACL);
            }
             FilesResponse response = new FilesResponse(client.execute(method));

            if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
              method.abort();
              if(login()) {
                new HttpPost(getCdnManagementURL()+"/"+sanitizeForURI(name));
                method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
                // TTL
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.