@Override public Date toDate(String date) throws IllegalArgumentException { return dateService.rfc822DateParse(date); }
@Override public Date toDate(String date) throws IllegalArgumentException { return dateService.rfc822DateParse(date); }
@Override public Date toDate(String date) throws IllegalArgumentException { return dateService.rfc822DateParse(date); }
@Override public Date toDate(String date) throws IllegalArgumentException { return dateService.rfc822DateParse(date); }
public Date get() { return dateService.rfc822DateParse(timestamp.get()); } }, seconds, TimeUnit.SECONDS);
public Date get() { return dateService.rfc822DateParse(timestamp.get()); } }, seconds, TimeUnit.SECONDS);
@Test(expectedExceptions = IllegalArgumentException.class) public void testRfc822DateParseIllegal() { dateService.rfc822DateParse("foo"); }
@Test public void testRfc822DateParse() { Date dsDate = dateService.rfc822DateParse(testData[0].rfc822DateString); assertEquals(dsDate, testData[0].date); }
@Override @Test(enabled = false) public void testRfc822DateParse() { Date dsDate = dateService.rfc822DateParse(testData[0].rfc822DateString); assertEquals(dsDate, testData[0].date); } }
@Test public void testRfc822DateParse() { Date dsDate = dateService.rfc822DateParse(testData[0].rfc822DateString); assertEquals(dsDate, testData[0].date); }
@Override protected Supplier<Date> provideTimeStampCacheDate( @Named(Constants.PROPERTY_SESSION_INTERVAL) long seconds, @TimeStamp final Supplier<String> timestamp, final DateService dateService) { return Suppliers.ofInstance(dateService.rfc822DateParse(TIMESTAMP)); } }
@Override protected Supplier<Date> provideTimeStampCacheDate( @Named(Constants.PROPERTY_SESSION_INTERVAL) long seconds, @TimeStamp final Supplier<String> timestamp, final DateService dateService) { return Suppliers.ofInstance(dateService.rfc822DateParse(TIMESTAMP)); } }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@VisibleForTesting void parseLastModifiedOrThrowException(HttpResponse from, MutableContainerPropertiesWithMetadata metadata) throws HttpException { String lastModified = from.getFirstHeaderOrNull(HttpHeaders.LAST_MODIFIED); if (lastModified == null) throw new HttpException(HttpHeaders.LAST_MODIFIED + " header not present in response: " + from); metadata.setLastModified(dateParser.rfc822DateParse(lastModified)); if (metadata.getLastModified() == null) throw new HttpException("could not parse: " + HttpHeaders.LAST_MODIFIED + ": " + lastModified); }
@Override @TimeStamp protected Supplier<Date> provideTimeStampCacheDate( @Named(Constants.PROPERTY_SESSION_INTERVAL) long seconds, @TimeStamp final Supplier<String> timestamp, final DateService dateService) { return Suppliers.ofInstance(dateService.rfc822DateParse(TIMESTAMP)); } }
public void testOptions() { InputStream is = getClass().getResourceAsStream("/test_list_blobs_options.xml"); Set<BlobProperties> contents = ImmutableSet.<BlobProperties> of(new BlobPropertiesImpl(BlobType.BLOCK_BLOB, "a", "adriancole-blobstore3", URI.create("https://jclouds.blob.core.windows.net/adriancole-blobstore3/a"), dateService.rfc822DateParse("Sat, 30 Jan 2010 17:46:15 GMT"), "0x8CC6FEB41736428", 8, "application/octet-stream", null, null, null, null, LeaseStatus.UNLOCKED, ImmutableMap.<String, String> of())); ListBlobsResponse list = new HashSetListBlobsResponse(contents, URI.create("https://jclouds.blob.core.windows.net/adriancole-blobstore3"), null, null, 1, "2!68!MDAwMDA2IWFwcGxlcyEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiE-", "/", Sets.<String> newTreeSet()); ListBlobsResponse result = factory.create( injector.getInstance(ContainerNameEnumerationResultsHandler.class)).parse(is); assertEquals(result, list); } }