Resources implements Iterable<Resource> { public Iterator<Resource> iterator(final String projectName) { return new ResourceListIterator(projectName, null); } Resources(Odps odps); void create(FileResource r, InputStream in); void create(String projectName, FileResource r, InputStream in); void create(TableResource r); void create(String projectName, TableResource r); void create(VolumeResource r); void create(String projectName, VolumeResource r); void update(VolumeResource r); void update(String projectName, VolumeResource r); void update(TableResource r); void update(String projectName, TableResource r); void update(FileResource r, InputStream in); void update(String projectName, FileResource r, InputStream in); InputStream getResourceAsStream(String projectName, String name); InputStream getResourceAsStream(String name); Resource get(String name); Resource get(String projectName, String name); boolean exists(String resourceName); boolean exists(String projectName, String resourceName); void delete(String name); void delete(String projectName, String name); FileResource createTempResource(String fileName); FileResource createTempResource(String projectName, String fileName); FileResource createTempResource(String projectName, String fileName, Resource.Type type); Iterator<Resource> iterator(final String projectName); @Override Iterator<Resource> iterator(); Iterable<Resource> iterable(final String projectName); Iterable<Resource> iterable();  }
@Test public void testIterator() { Iterator<Resource> iterator = odps.resources().iterator(); if (iterator.hasNext()) { iterator.next().getName(); } }