All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.algorithmia.data.DataDirectoryIterator Maven / Gradle / Ivy

There is a newer version: 1.0.16
Show newest version
package com.algorithmia.data;

import com.algorithmia.APIException;
import java.util.ArrayList;
import java.util.List;

public class DataDirectoryIterator extends AbstractDataIterator {
    public DataDirectoryIterator(DataDirectory dir) {
        super(dir);
    }

    protected void loadNextPage() throws APIException {
        List dirnames = new ArrayList();
        DataDirectory.DirectoryListResponse response = dir.getPage(marker, false);

        if (response.folders != null) {
            for(DataDirectory.DirectoryMetadata meta : response.folders) {
                dirnames.add(meta.name);
            }
        }

        // Update iterator state
        setChildrenAndMarker(dirnames, response.marker);
    }

    protected DataDirectory newDataObjectInstance(String dataUri) {
        return new DataDirectory(dir.client, dataUri);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy