Package org.jclouds.io

Examples of org.jclouds.io.Payload.release()


      function.setContext(request);
      expect(response.getStatusCode()).andReturn(200).atLeastOnce();
      expect(response.getFirstHeaderOrNull(CONTENT_TYPE)).andReturn("text/plain");
      expect(response.getFirstHeaderOrNull(LOCATION)).andReturn("path");
      expect(response.getPayload()).andReturn(payload).atLeastOnce();
      payload.release();

      replay(payload);
      replay(response);
      assertEquals(function.apply(response), URI.create("http://new/path"));
      verify(response);
View Full Code Here


      function.setContext(request);
      expect(response.getStatusCode()).andReturn(200).atLeastOnce();
      expect(response.getFirstHeaderOrNull(CONTENT_TYPE)).andReturn("text/plain");
      expect(response.getFirstHeaderOrNull(LOCATION)).andReturn("path");
      expect(response.getPayload()).andReturn(payload).atLeastOnce();
      payload.release();

      replay(payload);
      replay(response);
      assertEquals(function.apply(response), URI.create("http://new:8080/path"));
      verify(response);
View Full Code Here

      function.setContext(request);
      expect(response.getStatusCode()).andReturn(200).atLeastOnce();
      expect(response.getFirstHeaderOrNull(CONTENT_TYPE)).andReturn("text/plain");
      expect(response.getFirstHeaderOrNull(LOCATION)).andReturn("path");
      expect(response.getPayload()).andReturn(payload).atLeastOnce();
      payload.release();

      replay(payload);
      replay(response);
      assertEquals(function.apply(response), URI.create("https://new/path"));
      verify(response);
View Full Code Here

               logger.debug("Could not delete %s", outputFile);
            }
         }
         throw ex;
      } finally {
         payload.release();
      }
   }

   @Override
   public void removeBlob(final String container, final String blobKey) {
View Full Code Here

            }
         }
         throw ex;
      } finally {
         Closeables.closeQuietly(his);
         payload.release();
      }
   }

   @Override
   public void removeBlob(final String container, final String blobKey) {
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(request.getHeader("Content-MD5"), strDigest);
         assertEquals(headers.get("x-Content-MD5"), ImmutableList.of(strDigest));
      } finally {
         if (payload != null) {
            payload.release();
         }
         if (f != null && f.exists()) {
            f.delete();
         }
         close(client, true);
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(request.getHeader("Content-Disposition"), "attachment; filename=photo.jpg");
         assertEquals(headers.get("x-Content-Disposition"), ImmutableList.of("attachment; filename=photo.jpg"));
      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(request.getHeader("Content-Encoding"), "gzip");
         assertEquals(headers.get("x-Content-Encoding"), ImmutableList.of("gzip"));
      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }
View Full Code Here

         RecordedRequest request = server.takeRequest();
         assertEquals(request.getHeader("Content-Language"), "mi, en");
         assertEquals(headers.get("x-Content-Language"), ImmutableList.of("mi, en"));
      } finally {
         if (payload != null) {
            payload.release();
         }
         close(client, true);
         server.shutdown();
      }
   }
View Full Code Here

                    throw new IOException("Could not rename file");
                }
            } catch (IOException ex) {
                tempFile.delete();
            } finally {
                payload.release();
                downloadContext.stop();
            }
            return name;
        }
    }
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.