@Override
    public PathAttributes find(final Path file, final ListProgressListener listener) throws BackgroundException {
        if(file.isRoot()) {
            return PathAttributes.EMPTY;
        }
        if(file.getType().contains(Path.Type.upload)) {
            // Pending large file upload
            final Write.Append append = new B2LargeUploadService(session, fileid, new B2WriteFeature(session, fileid)).append(file, new TransferStatus());
            if(append.append) {
                return new PathAttributes().withSize(append.offset);
            }
            return PathAttributes.EMPTY;
        }
        if(containerService.isContainer(file)) {
            try {
                final B2BucketResponse info = session.getClient().listBucket(file.getName());
                if(null == info) {
                    throw new NotfoundException(file.getAbsolute());
                }
                return this.toAttributes(info);
            }
            catch(B2ApiException e) {
                throw new B2ExceptionMappingService(fileid).map("Failure to read attributes of {0}", e, file);
            }
            catch(IOException e) {
                throw new DefaultIOExceptionMappingService().map(e);
            }
        }
        else {
            final String id = fileid.getVersionId(file);
            if(null == id) {
                return PathAttributes.EMPTY;
            }
            B2FileResponse response;
            try {
                response = this.findFileInfo(file, id);
            }
            catch(NotfoundException e) {
                // Try with reset cache after failure finding node id
                response = this.findFileInfo(file, fileid.getVersionId(file));
            }
            final PathAttributes attr = this.toAttributes(response);
            if(attr.isDuplicate()) {
                // Throw failure if latest version has hide marker set and lookup was without explicit version
                if(StringUtils.isBlank(file.attributes().getVersionId())) {
                    if(log.isDebugEnabled()) {
                        log.debug(String.format("Latest version of %s is duplicate", file));
                    }
                    throw new NotfoundException(file.getAbsolute());
                }
            }
            return attr;
        }
    }
@Test
    public void testFindLargeUpload() throws Exception {
        final Path bucket = new Path("test-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
        final Path file = new Path(bucket, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file, Path.Type.upload));
        final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
        final B2StartLargeFileResponse startResponse = session.getClient().startLargeFileUpload(
                fileid.getVersionId(bucket),
                file.getName(), null, Collections.emptyMap());
        final PathAttributes attributes = new B2AttributesFinderFeature(session, fileid).find(file);
        assertNotSame(PathAttributes.EMPTY, attributes);
        assertEquals(0L, attributes.getSize());
        new B2ReadFeature(session, fileid).read(file, new TransferStatus(), new DisabledConnectionCallback()).close();
        final Path found = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener()).find(
                new SimplePathPredicate(file));
        assertTrue(found.getType().contains(Path.Type.upload));
        new B2ReadFeature(session, fileid).read(found, new TransferStatus(), new DisabledConnectionCallback()).close();
        session.getClient().cancelLargeFileUpload(startResponse.getFileId());
    }