diff --git a/azure-client-runtime/build.gradle b/azure-client-runtime/build.gradle index dcdaddcea285b..52894c8727a61 100644 --- a/azure-client-runtime/build.gradle +++ b/azure-client-runtime/build.gradle @@ -30,7 +30,7 @@ uploadArchives { repositories { mavenDeployer { configuration = configurations.deployerJars - snapshotRepository(url: "ftp://waws-prod-bay-005.ftp.azurewebsites.windows.net/site/wwwroot/") { + snapshotRepository(url: "file://\\\\aaptfile01\\ADXSDK\\Java\\internal-snapshots") { authentication(userName: username, password: password) } pom.setArtifactId "azure-client-runtime" diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java b/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java index 81aabf55f5565..c2441cfd6cc26 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/PagedList.java @@ -10,6 +10,7 @@ import com.microsoft.rest.RestException; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -30,6 +31,12 @@ public abstract class PagedList implements List { private List items; /** Stores the link to get the next page of items. */ private String nextPageLink; + /** Stores the latest page fetched. */ + private Page currentPage; + + public PagedList() { + items = new ArrayList<>(); + } /** * Creates an instance of PagedList from a {@link Page} response. @@ -39,6 +46,7 @@ public abstract class PagedList implements List { public PagedList(Page page) { items = page.getItems(); nextPageLink = page.getNextPageLink(); + currentPage = page; } /** @@ -69,12 +77,12 @@ public void loadNextPage() { Page nextPage = nextPage(this.nextPageLink); this.nextPageLink = nextPage.getNextPageLink(); this.items.addAll(nextPage.getItems()); + this.currentPage = nextPage; } catch (RestException e) { throw new WebServiceException(e.toString(), e); } catch (IOException e) { throw new DataBindingException(e.getMessage(), e); } - } /** @@ -86,6 +94,24 @@ public void loadAll() { } } + /** + * Gets the latest page fetched. + * + * @return the latest page. + */ + public Page currentPage() { + return currentPage; + } + + /** + * Gets the next page's link. + * + * @return the next page link. + */ + public String nextPageLink() { + return nextPageLink; + } + /** * The implementation of {@link ListIterator} for PagedList. */