@Test public void testIfModifiedSince() { Date ifModifiedSince = new Date(999999L); org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions(); in.ifModifiedSince(ifModifiedSince); GetOptions expected = new GetOptions(); expected.ifModifiedSince(ifModifiedSince); assertEquals(fn.apply(in), expected); }
@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; }
BlobToHttpGetOptions implements Function<org.jclouds.blobstore.options.GetOptions, GetOptions> { @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; } }
BlobToHttpGetOptions implements Function<org.jclouds.blobstore.options.GetOptions, GetOptions> { @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; }  }
BlobToHttpGetOptions implements Function<org.jclouds.blobstore.options.GetOptions, GetOptions> { @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 GetOptions apply(org.jclouds.blobstore.options.GetOptions from); }
BlobToHttpGetOptions implements Function<org.jclouds.blobstore.options.GetOptions, GetOptions> { @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 GetOptions apply(org.jclouds.blobstore.options.GetOptions from);  }