/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testETagMatchesAfterIfModified() { ifModifiedSince(now).ifETagMatches(etag); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testETagMatchesAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifETagMatches(etag); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testETagMatchesAfterIfModified() { ifModifiedSince(now).ifETagMatches(etag); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testETagMatchesAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifETagMatches(etag); }
public void testETagMatchesAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagMatches(etag); }
public void testETagMatchesAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagMatches(etag); }
@Override public GetOptions apply(org.jclouds.blobstore.options.GetOptions from) { checkNotNull(from, "options"); if (from == org.jclouds.blobstore.options.GetOptions.NONE) return GetOptions.NONE; GetOptions httpOptions = new GetOptions(); if (from.getIfMatch() != null) { httpOptions.ifETagMatches(from.getIfMatch()); } if (from.getIfModifiedSince() != null) { httpOptions.ifModifiedSince(from.getIfModifiedSince()); } if (from.getIfNoneMatch() != null) { httpOptions.ifETagDoesntMatch(from.getIfNoneMatch()); } if (from.getIfUnmodifiedSince() != null) { httpOptions.ifUnmodifiedSince(from.getIfUnmodifiedSince()); } for (String range : from.getRanges()) { String[] firstLast = range.split("\\-", 2); if (!firstLast[0].isEmpty() && !firstLast[1].isEmpty()) httpOptions.range(Long.parseLong(firstLast[0]), Long.parseLong(firstLast[1])); else if (firstLast[0].isEmpty() && !firstLast[1].isEmpty()) httpOptions.tail(Long.parseLong(firstLast[1])); else httpOptions.startAt(Long.parseLong(firstLast[0])); } return httpOptions; } }
@Override public GetOptions apply(org.jclouds.blobstore.options.GetOptions from) { checkNotNull(from, "options"); if (from == org.jclouds.blobstore.options.GetOptions.NONE) return GetOptions.NONE; GetOptions httpOptions = new GetOptions(); if (from.getIfMatch() != null) { httpOptions.ifETagMatches(from.getIfMatch()); } if (from.getIfModifiedSince() != null) { httpOptions.ifModifiedSince(from.getIfModifiedSince()); } if (from.getIfNoneMatch() != null) { httpOptions.ifETagDoesntMatch(from.getIfNoneMatch()); } if (from.getIfUnmodifiedSince() != null) { httpOptions.ifUnmodifiedSince(from.getIfUnmodifiedSince()); } for (String range : from.getRanges()) { String[] firstLast = range.split("\\-", 2); if (!firstLast[0].isEmpty() && !firstLast[1].isEmpty()) httpOptions.range(Long.parseLong(firstLast[0]), Long.parseLong(firstLast[1])); else if (firstLast[0].isEmpty() && !firstLast[1].isEmpty()) httpOptions.tail(Long.parseLong(firstLast[1])); else httpOptions.startAt(Long.parseLong(firstLast[0])); } return httpOptions; } }
@Test public void testIfETagMatches() { GetOptions options = new GetOptions(); options.ifETagMatches(etag); matchesHex(options.getIfMatch()); }
@Test public void testIfETagMatches() { GetOptions options = new GetOptions(); options.ifETagMatches(etag); matchesHex(options.getIfMatch()); }
@Test public void testIfMatch() { String ifMatch = "foo"; org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions(); in.ifETagMatches(ifMatch); GetOptions expected = new GetOptions(); expected.ifETagMatches(ifMatch); assertEquals(fn.apply(in), expected); }
@Test public void testIfMatch() { String ifMatch = "foo"; org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions(); in.ifETagMatches(ifMatch); GetOptions expected = new GetOptions(); expected.ifETagMatches(ifMatch); assertEquals(fn.apply(in), expected); }
public GetOptions apply(org.jclouds.blobstore.options.GetOptions from) { GetOptions httpOptions = new GetOptions(); if (from != null) { if (from.getIfMatch() != null) { httpOptions.ifETagMatches(from.getIfMatch()); } if (from.getIfModifiedSince() != null) { httpOptions.ifModifiedSince(from.getIfModifiedSince()); } if (from.getIfNoneMatch() != null) { httpOptions.ifETagDoesntMatch(from.getIfNoneMatch()); } if (from.getIfUnmodifiedSince() != null) { httpOptions.ifUnmodifiedSince(from.getIfUnmodifiedSince()); } for (String range : from.getRanges()) { String[] firstLast = range.split("\\-"); if (firstLast.length == 2) httpOptions.range(Long.parseLong(firstLast[0]), Long.parseLong(firstLast[1])); else if (range.startsWith("-")) httpOptions.tail(Long.parseLong(firstLast[0])); else httpOptions.startAt(Long.parseLong(firstLast[0])); } } return httpOptions; } }
public GetOptions apply(org.jclouds.blobstore.options.GetOptions from) { GetOptions httpOptions = new GetOptions(); if (from != null) { if (from.getIfMatch() != null) { httpOptions.ifETagMatches(from.getIfMatch()); } if (from.getIfModifiedSince() != null) { httpOptions.ifModifiedSince(from.getIfModifiedSince()); } if (from.getIfNoneMatch() != null) { httpOptions.ifETagDoesntMatch(from.getIfNoneMatch()); } if (from.getIfUnmodifiedSince() != null) { httpOptions.ifUnmodifiedSince(from.getIfUnmodifiedSince()); } for (String range : from.getRanges()) { String[] firstLast = range.split("\\-"); if (firstLast.length == 2) httpOptions.range(Long.parseLong(firstLast[0]), Long.parseLong(firstLast[1])); else if (range.startsWith("-")) httpOptions.tail(Long.parseLong(firstLast[0])); else httpOptions.startAt(Long.parseLong(firstLast[0])); } } return httpOptions; } }