/** * Makes the next listBlob call if necessary and updates the currentIterator. * * @throws StorageException * @throws URISyntaxException */ private void updateIterator() throws StorageException, URISyntaxException { if (this.currentPrefixTime != null && this.currentPrefixTime.isEmpty()) { // If we've already called listBlobs() with an empty prefix, don't do so again. this.isExpired = true; return; } GregorianCalendar now = new GregorianCalendar(); now.add(GregorianCalendar.HOUR_OF_DAY, 1); now.setTimeZone(TimeZone.getTimeZone("GMT")); updatePrefix(); if ((this.startDate == null || this.startDate.compareTo(now) <= 0) && (this.endDate == null || ((this.logDirectory.getPrefix() + this.currentPrefixTime) .compareTo(this.endPrefix) <= 0))) { // Only make the next call if the prefix is still possible this.currentIterator = this.logDirectory.listBlobs(this.currentPrefixTime, true, this.details, this.options, this.opContext).iterator(); } else { // We are in the future. this.isExpired = true; } }
/** * Makes the next listBlob call if necessary and updates the currentIterator. * * @throws StorageException * @throws URISyntaxException */ private void updateIterator() throws StorageException, URISyntaxException { if (this.currentPrefixTime != null && this.currentPrefixTime.isEmpty()) { // If we've already called listBlobs() with an empty prefix, don't do so again. this.isExpired = true; return; } GregorianCalendar now = new GregorianCalendar(); now.add(GregorianCalendar.HOUR_OF_DAY, 1); now.setTimeZone(TimeZone.getTimeZone("GMT")); updatePrefix(); if ((this.startDate == null || this.startDate.compareTo(now) <= 0) && (this.endDate == null || ((this.logDirectory.getPrefix() + this.currentPrefixTime) .compareTo(this.endPrefix) <= 0))) { // Only make the next call if the prefix is still possible this.currentIterator = this.logDirectory.listBlobs(this.currentPrefixTime, true, this.details, this.options, this.opContext).iterator(); } else { // We are in the future. this.isExpired = true; } }