public String registerFileResource(ResourceUri resourceUri) throws IOException {
        Map<ResourceUri, URL> stagingResources =
                prepareStagingResources(
                        Collections.singletonList(resourceUri),
                        ResourceType.FILE,
                        false,
                        url -> {},
                        false);
        registerResources(stagingResources, false);
        return resourceInfos.get(new ArrayList<>(stagingResources.keySet()).get(0)).getPath();
    }
@Test
    public void testRegisterFileResource() throws Exception {
        ResourceUri normalizedResource =
                new ResourceUri(
                        ResourceType.FILE,
                        resourceManager.getURLFromPath(new Path(file.getPath())).getPath());

        // register file resource, uri is formatted with "file" scheme prefix
        String localFilePath =
                resourceManager.registerFileResource(
                        new ResourceUri(ResourceType.FILE, "file://" + file.getPath()));
        assertEquals(file.getPath(), localFilePath);
        Map<ResourceUri, URL> actualResource =
                Collections.singletonMap(
                        normalizedResource,
                        resourceManager.getURLFromPath(new Path(localFilePath)));
        assertThat(resourceManager.getResources()).containsExactlyEntriesOf(actualResource);

        // register the same file resource repeatedly, but without scheme
        assertThat(
                        resourceManager.registerFileResource(
                                new ResourceUri(ResourceType.FILE, file.getPath())))
                .isEqualTo(localFilePath);
        assertThat(resourceManager.getResources()).containsExactlyEntriesOf(actualResource);

        // register the same file resource repeatedly, use relative path as uri
        assertThat(
                        resourceManager.registerFileResource(
                                new ResourceUri(
                                        ResourceType.FILE,
                                        new File(".")
                                                .getCanonicalFile()
                                                .toPath()
                                                .relativize(file.toPath())
                                                .toString())))
                .isEqualTo(localFilePath);
        assertThat(resourceManager.getResources()).containsExactlyEntriesOf(actualResource);
    }