Package org.apache.http.client.methods

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


                                                 response.getStatusLine());
                    }

                } finally {
                    if (method != null) {
                        method.abort();
                    }
                }
            } else {
                if (!isValidContainerName(sourceContainer)) {
                    throw new FilesInvalidNameException(sourceContainer);
View Full Code Here


                return responseBody.getBoolean("boolean");
            } else {
                return false;
            }
        } catch (IOException e) {
            method.abort();
            throw e;
        }
    }

    /**
 
View Full Code Here

        };

        try {
            httpClient.execute(put, handler);
        } catch(IOException ex) {
            put.abort();
            throw ex;
        } finally {
            put.releaseConnection();
        }
View Full Code Here

        HttpResponse response = client.execute(cmd);
        int code = response.getStatusLine().getStatusCode();

        credentials.checkCode(response,code,"PUT:" + container +":" + key);
        cmd.abort();   
    }

    public void copy(String container, String srcKey, String dstKey) throws Exception {
        getAuth();
        HttpPut cmd = new HttpPut(storageUrl + "/" + container +"/" + dstKey);
View Full Code Here

        HttpResponse response = client.execute(cmd);
        int code = response.getStatusLine().getStatusCode();

        credentials.checkCode(response,code,"COPY:" + container +":" + srcKey +":" + dstKey);
        cmd.abort();   
    }

    private static String bytesToHexString(byte[] bytes) {
        StringBuilder sb = new StringBuilder(bytes.length * 2);
        Formatter formatter = new Formatter(sb);
View Full Code Here

        HttpResponse response = client.execute(cmd);
        int code = response.getStatusLine().getStatusCode();

        credentials.checkCode(response,code,"PUT:" + container +":" + key);
        cmd.abort();   
    }

    public void delete(String container, String key) throws Exception {
        getAuth();
        HttpDelete cmd = new HttpDelete(storageUrl + "/" + container +"/" + key);
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 an json API POST operation.
  *@param apiURL is the operation.
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 an json API POST operation.
  *@param apiURL is the operation.
View Full Code Here

            firePutCompleted( resource, source );
        }
        finally
        {
            putMethod.abort();
        }
    }

    protected String calculateRelocatedUrl( HttpResponse response )
    {
View Full Code Here

         put.setEntity(new ByteArrayEntity(marshall(contentType, entry), ContentType.create(contentType)));
         httpClient.execute(httpHost, put);
      } catch (Exception e) {
         throw new PersistenceException(e);
      } finally {
         put.abort();
      }
   }

   @Override
   public void clear() {
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.