@Override
    public PathAttributes find(final Path file, final ListProgressListener listener) throws BackgroundException {
        try {
            // Metadata for the root folder is unsupported
            if(file.isRoot()) {
                // Retrieve the namespace ID for a users home folder and team root folder
                final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount();
                if(log.isDebugEnabled()) {
                    log.debug(String.format("Set root namespace %s", account.getRootInfo().getRootNamespaceId()));
                }
                return new PathAttributes().withFileId(account.getRootInfo().getRootNamespaceId());
            }
            final Metadata metadata = new DbxUserFilesRequests(session.getClient(file)).getMetadata(containerService.getKey(file));
            if(metadata instanceof FileMetadata) {
                if(file.isDirectory()) {
                    throw new NotfoundException(file.getAbsolute());
                }
            }
            if(metadata instanceof FolderMetadata) {
                if(file.isFile()) {
                    throw new NotfoundException(file.getAbsolute());
                }
            }
            return this.toAttributes(metadata);
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Failure to read attributes of {0}", e, file);
        }
    }
@Test
    public void testFindFile() throws Exception {
        final Path root = new DefaultHomeFinderService(session).find();
        final Path folder = new DropboxDirectoryFeature(session).mkdir(new Path(root,
                new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null);
        final DropboxAttributesFinderFeature f = new DropboxAttributesFinderFeature(session);
        assertEquals(-1L, f.find(folder).getModificationDate());
        final Path file = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        new DropboxTouchFeature(session).touch(file, new TransferStatus());
        final PathAttributes attr = f.find(file);
        assertEquals("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", attr.getChecksum().hash);
        assertNotEquals(-1L, attr.getModificationDate());
        assertNotNull(attr.getVersionId());
        new DropboxDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }