@Override
    public Map<String, String> getMetadata(final Path file) throws BackgroundException {
        try {
            final String fileid = this.fileid.getFileId(file);
            final Map<String, String> properties = session.getClient().files().get(fileid).setFields("properties")
                .setSupportsAllDrives(new HostPreferences(session.getHost()).getBoolean("googledrive.teamdrive.enable")).execute().getProperties();
            if(null == properties) {
                return Collections.emptyMap();
            }
            return properties;
        }
        catch(IOException e) {
            throw new DriveExceptionMappingService(fileid).map("Failure to read attributes of {0}", e, file);
        }
    }
@Test
    public void testChangedFileId() throws Exception {
        final DriveFileIdProvider fileid = new DriveFileIdProvider(session);
        final Path room = new DriveDirectoryFeature(session, fileid).mkdir(
                new Path(MYDRIVE_FOLDER, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
        final Path test = new DriveTouchFeature(session, fileid).touch(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        final String latestfileid = test.attributes().getFileId();
        assertNotNull(latestfileid);
        // Assume previously seen but changed on server
        fileid.cache(test, String.valueOf(RandomUtils.nextLong()));
        final DriveMetadataFeature f = new DriveMetadataFeature(session, fileid);
        try {
            f.getMetadata(test);
        }
        catch(NotfoundException e) {
            assertNull(test.attributes().getFileId());
        }
        new DriveDeleteFeature(session, fileid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }