public CloudFilesObject get(String path, long start) { final SwiftObject swiftObject; if (start == 0) { swiftObject = objectApi.get(path); } else { swiftObject = objectApi.get(path, new GetOptions().startAt(start)); } Payload payload = swiftObject.getPayload(); return new CloudFilesObject(payload, this.region, this.container, path); }
/** * @see GetOptions#ifETagDoesntMatch(String) */ public static GetOptions ifETagDoesntMatch(String eTag) { GetOptions options = new GetOptions(); return options.ifETagDoesntMatch(eTag); }
/** * @see GetOptions#ifUnmodifiedSince(Date) */ public static GetOptions ifUnmodifiedSince(Date ifUnmodifiedSince) { GetOptions options = new GetOptions(); return options.ifUnmodifiedSince(ifUnmodifiedSince); }
/** * @see GetOptions#range(long, long) */ public static GetOptions range(long start, long end) { GetOptions options = new GetOptions(); return options.range(start, end); }
/** * @see GetOptions#getIfModifiedSince() */ public static GetOptions ifModifiedSince(Date ifModifiedSince) { GetOptions options = new GetOptions(); return options.ifModifiedSince(ifModifiedSince); }
/** * @see GetOptions#ifETagMatches(String) */ public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); }
/** * @see GetOptions#tail(long) */ public static GetOptions tail(long count) { GetOptions options = new GetOptions(); return options.tail(count); }
public void testIfModifiedAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifModifiedSince(now); }
public void testIfUnmodifiedAfterETagMatches() { ifETagMatches(etag).ifUnmodifiedSince(now); }
@Test public void testIfETagMatchesStatic() { GetOptions options = ifETagMatches(etag); matchesHex(options.getIfMatch()); }
@Test public void testIfETagDoesntMatchStatic() { GetOptions options = ifETagDoesntMatch(etag); matchesHex(options.getIfNoneMatch()); }
/** * For use in the request header: If-Match * <p /> * Return the object only if its payload tag (ETag) is the same as the eTag specified, otherwise * return a 412 (precondition failed). * * @see #ifETagMatches(String) */ public String getIfMatch() { return this.getFirstHeaderOrNull(IF_MATCH); }
/** * @see GetOptions#startAt(long) */ public static GetOptions startAt(long start) { GetOptions options = new GetOptions(); return options.startAt(start); }
/** * @see GetOptions#ifUnmodifiedSince(Date) */ public static GetOptions ifUnmodifiedSince(Date ifUnmodifiedSince) { GetOptions options = new GetOptions(); return options.ifUnmodifiedSince(ifUnmodifiedSince); }
/** * @see GetOptions#getIfModifiedSince() */ public static GetOptions ifModifiedSince(Date ifModifiedSince) { GetOptions options = new GetOptions(); return options.ifModifiedSince(ifModifiedSince); }
@Test public void testIfETagMatchesStatic() { GetOptions options = ifETagMatches(etag); matchesHex(options.getIfMatch()); }
/** * For use in the header If-Modified-Since * <p /> * Return the object only if it has been modified since the specified time, otherwise return a * 304 (not modified). * * @see #ifModifiedSince(Date) */ public String getIfModifiedSince() { return this.getFirstHeaderOrNull(IF_MODIFIED_SINCE); }
/** * For use in the header If-Unmodified-Since * <p /> * Return the object only if it has not been modified since the specified time, otherwise return * a 412 (precondition failed). * * @see #ifUnmodifiedSince(Date) */ public String getIfUnmodifiedSince() { return this.getFirstHeaderOrNull(IF_UNMODIFIED_SINCE); }
/** * For use in the request header: If-None-Match * <p /> * Return the object only if its payload tag (ETag) is different from the one specified, * otherwise return a 304 (not modified). * * @see #ifETagDoesntMatch(String) */ public String getIfNoneMatch() { return this.getFirstHeaderOrNull(IF_NONE_MATCH); }
/** * For use in the request header: If-Match * <p /> * Return the object only if its payload tag (ETag) is the same as the eTag specified, otherwise * return a 412 (precondition failed). * * @see #ifETagMatches(String) */ public String getIfMatch() { return this.getFirstHeaderOrNull(IF_MATCH); }