@Override
    public String getFileId(final Path file) throws BackgroundException {
        if(StringUtils.isNotBlank(file.attributes().getFileId())) {
            return file.attributes().getFileId();
        }
        if(file.isRoot()
                || new SimplePathPredicate(file).test(DriveHomeFinderService.MYDRIVE_FOLDER)
                || new SimplePathPredicate(file).test(DriveHomeFinderService.SHARED_FOLDER_NAME)
                || new SimplePathPredicate(file).test(DriveHomeFinderService.SHARED_DRIVES_NAME)) {
            return DriveHomeFinderService.ROOT_FOLDER_ID;
        }
        final String cached = super.getFileId(file);
        if(cached != null) {
            if(log.isDebugEnabled()) {
                log.debug(String.format("Return cached fileid %s for file %s", cached, file));
            }
            return cached;
        }
        if(new SimplePathPredicate(DriveHomeFinderService.SHARED_DRIVES_NAME).test(file.getParent())) {
            final Path found = new DriveTeamDrivesListService(session, this).list(file.getParent(),
                    new DisabledListProgressListener()).find(new SimplePathPredicate(file)
            );
            if(null == found) {
                throw new NotfoundException(file.getAbsolute());
            }
            return this.cache(file, found.attributes().getFileId());
        }
        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 = new FileidDriveListService(session, this, query).list(file.getParent(), new DisabledListProgressListener());
        final Path found = list.filter(new IgnoreTrashedComparator()).find(new SimplePathPredicate(file));
        if(null == found) {
            throw new NotfoundException(file.getAbsolute());
        }
        return this.cache(file, found.attributes().getFileId());
    }
@Test
    public void testGetFileidSingleQuoteCharacter() throws Exception {
        final Path test = new Path(DriveHomeFinderService.MYDRIVE_FOLDER, String.format("%s'", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.file));
        final DriveFileIdProvider driveFileIdProvider = new DriveFileIdProvider(session);
        new DriveTouchFeature(session, driveFileIdProvider).touch(test, new TransferStatus());
        assertNotNull(driveFileIdProvider.getFileId(test));
        new DriveDeleteFeature(session, driveFileIdProvider).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }