From 3bb0d1ff2f772a8dce9bc0dc712ffb0ede564d45 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 23 Mar 2026 13:51:01 +0100 Subject: [PATCH] No notify of listener with single file. --- .../DriveAttributesFinderFeature.java | 17 +++++++++-------- .../DriveAttributesFinderFeatureTest.java | 8 +++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeature.java b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeature.java index d9b6f816e0..0e645f91c6 100644 --- a/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeature.java +++ b/googledrive/src/main/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeature.java @@ -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 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) { diff --git a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeatureTest.java b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeatureTest.java index 9bb5e687b6..ac4b75005b 100644 --- a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeatureTest.java +++ b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveAttributesFinderFeatureTest.java @@ -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 list) throws ListCanceledException { + fail(); + } + }); assertEquals(0L, attributes.getSize()); assertNotNull(attributes.getFileId()); assertNull(attributes.getVersionId());