@Test public void testListLexicographicSortOrderAssumption() throws Exception { final Path container = new Path("test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path directory = new GoogleStorageDirectoryFeature(session).mkdir( new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null, new TransferStatus()); assertTrue(new GoogleStorageObjectListService(session).list(directory, new DisabledListProgressListener()).isEmpty()); final List<String> files = Arrays.asList( "aa", "0a", "a", "AAA", "B", "~$a", ".c" ); for(String f : files) { new GoogleStorageTouchFeature(session).touch(new Path(directory, f, EnumSet.of(Path.Type.file)), new TransferStatus()); } files.sort(session.getHost().getProtocol().getListComparator()); final AttributedList<Path> list = new GoogleStorageObjectListService(session).list(directory, new DisabledListProgressListener()); for(int i = 0; i < list.size(); i++) { assertEquals(files.get(i), list.get(i).getName()); new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(list.get(i)), new DisabledLoginCallback(), new Delete.DisabledCallback()); } new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER), preferences.getInteger("googlestorage.listing.chunksize")); }
GoogleStorageObjectListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER), preferences.getInteger("googlestorage.listing.chunksize")); } }
GoogleStorageObjectListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER), preferences.getInteger("googlestorage.listing.chunksize")); } GoogleStorageObjectListService(final GoogleStorageSession session); }
GoogleStorageObjectListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER), preferences.getInteger("googlestorage.listing.chunksize")); } GoogleStorageObjectListService(final GoogleStorageSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); AttributedList<Path> list(final Path directory, final ListProgressListener listener, final String delimiter, final int chunksize); @Override ListService withCache(final Cache<Path> cache); }
GoogleStorageObjectListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER), preferences.getInteger("googlestorage.listing.chunksize")); } GoogleStorageObjectListService(final GoogleStorageSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); AttributedList<Path> list(final Path directory, final ListProgressListener listener, final String delimiter, final int chunksize); @Override ListService withCache(final Cache<Path> cache);  }