No notify of listener with single file.

This commit is contained in:
David Kocher
2026-03-23 13:51:01 +01:00
parent dfa3bb064e
commit 3bb0d1ff2f
2 changed files with 16 additions and 9 deletions
@@ -19,6 +19,7 @@ import ch.cyberduck.core.AttributedList;
import ch.cyberduck.core.DefaultPathAttributes;
import ch.cyberduck.core.DefaultPathContainerService;
import ch.cyberduck.core.DescriptiveUrl;
import ch.cyberduck.core.DisabledListProgressListener;
import ch.cyberduck.core.ListProgressListener;
import ch.cyberduck.core.LocaleFactory;
import ch.cyberduck.core.Path;
@@ -66,19 +67,19 @@ public class DriveAttributesFinderFeature implements AttributesFinder, Attribute
if(new DefaultPathContainerService().isContainer(file)) {
return PathAttributes.EMPTY;
}
final Path query;
if(file.isPlaceholder()) {
query = new Path(file.getParent(), FilenameUtils.removeExtension(file.getName()), file.getType(), file.attributes());
}
else {
query = file;
}
final AttributedList<Path> list;
if(new SimplePathPredicate(DriveHomeFinderService.SHARED_DRIVES_NAME).test(file.getParent())) {
list = new DriveTeamDrivesListService(session, fileid).list(file.getParent(), listener);
}
else {
list = new FileidDriveListService(session, fileid, query).list(file.getParent(), listener);
final Path query;
if(file.isPlaceholder()) {
query = new Path(file.getParent(), FilenameUtils.removeExtension(file.getName()), file.getType(), file.attributes());
}
else {
query = file;
}
list = new FileidDriveListService(session, fileid, query).list(file.getParent(), new DisabledListProgressListener());
}
final Path found = list.find(new ListFilteringFeature.ListFilteringPredicate(session.getCaseSensitivity(), file));
if(null == found) {
@@ -23,6 +23,7 @@ import ch.cyberduck.core.LoginCallback;
import ch.cyberduck.core.Path;
import ch.cyberduck.core.PathAttributes;
import ch.cyberduck.core.SimplePathPredicate;
import ch.cyberduck.core.exception.ListCanceledException;
import ch.cyberduck.core.exception.NotfoundException;
import ch.cyberduck.core.features.Delete;
import ch.cyberduck.core.preferences.PreferencesFactory;
@@ -89,7 +90,12 @@ public class DriveAttributesFinderFeatureTest extends AbstractDriveTest {
final DriveFileIdProvider fileid = new DriveFileIdProvider(session);
new DriveTouchFeature(session, fileid).touch(new DriveWriteFeature(session, fileid), test, new TransferStatus());
final DriveAttributesFinderFeature f = new DriveAttributesFinderFeature(session, fileid);
final PathAttributes attributes = f.find(test);
final PathAttributes attributes = f.find(test, new DisabledListProgressListener() {
@Override
public void chunk(final Path directory, final AttributedList<Path> list) throws ListCanceledException {
fail();
}
});
assertEquals(0L, attributes.getSize());
assertNotNull(attributes.getFileId());
assertNull(attributes.getVersionId());