public static Resource getResource(File workingDir, String path) {
        if (path.startsWith(Resource.CLASSPATH_COLON)) {
            path = removePrefix(path);
            File file = classPathToFile(path);
            if (file != null) {
                return new FileResource(file, true, path);
            }
            List<Resource> resources = new ArrayList<>();
            synchronized (SCAN_RESULT) {
                ResourceList rl = SCAN_RESULT.getResourcesWithPath(path);
                if (rl == null) {
                    rl = ResourceList.emptyList();
                }
                rl.forEachByteArrayIgnoringIOException((res, bytes) -> {
                    URI uri = res.getURI();
                    if ("file".equals(uri.getScheme())) {
                        File found = Paths.get(uri).toFile();
                        resources.add(new FileResource(found, true, res.getPath()));
                    } else {
                        resources.add(new JarResource(bytes, res.getPath(), uri));
                    }
                });
            }
            if (resources.isEmpty()) {
                throw new RuntimeException("not found: " + path);
            }
            return resources.get(0);
        } else {
            path = path.replace('\\', '/'); // windows fix
            File file = new File(removePrefix(path));
            if (!file.exists()) {
                throw new RuntimeException("not found: " + path);
            }
            Path relativePath = workingDir.toPath().relativize(file.getAbsoluteFile().toPath());
            return new FileResource(file, false, relativePath.toString());
        }
    }
@Test
    void testResolveRelativeClassPathFile() {
        Resource temp = ResourceUtils.getResource(new File(""), "classpath:com/intuit/karate/resource/dir1/dir1.log");
        Resource resource = temp.resolve("../dir2/dir2.log");
        assertTrue(resource.isFile());
        assertTrue(resource.isClassPath());
        assertEquals("com/intuit/karate/resource/dir1/../dir2/dir2.log", resource.getRelativePath());
        assertEquals("classpath:com/intuit/karate/resource/dir1/../dir2/dir2.log", resource.getPrefixedPath());
        assertEquals("bar", FileUtils.toString(resource.getStream()));
    }