@Test @ExtendWith(TemporaryFolderExtension.class) void getPolicyAsStringTest(TemporaryFolder temporaryFolder) throws IOException { File root = new File(temporaryFolder.getRoot(), "a"); File a = new File(root, "a"); File b = new File(a, "b"); File c = new File(b, "c"); c.mkdirs(); File policy = new File(c, "policy.xml"); Files.touch(policy); String path = getPath(policy, root); assertEquals("a/b/c/policy.xml", path); }
static String getPath(final File policy, final File policyRootDir) { String path = policyRootDir.toURI().relativize(policy.toURI()).getPath(); if (policy.isFile() || path.isEmpty()) { return PathUtils.unixPath(path); } return PathUtils.unixPathEndingWithSeparator(path); }
FolderLoaderUtils { static String getPath(final File policy, final File policyRootDir) { String path = policyRootDir.toURI().relativize(policy.toURI()).getPath(); if (policy.isFile() || path.isEmpty()) { return PathUtils.unixPath(path); } return PathUtils.unixPathEndingWithSeparator(path); } }
FolderLoaderUtils { static String getPath(final File policy, final File policyRootDir) { String path = policyRootDir.toURI().relativize(policy.toURI()).getPath(); if (policy.isFile() || path.isEmpty()) { return PathUtils.unixPath(path); } return PathUtils.unixPathEndingWithSeparator(path); } private  FolderLoaderUtils(); }
FolderLoaderUtils { static String getPath(final File policy, final File policyRootDir) { String path = policyRootDir.toURI().relativize(policy.toURI()).getPath(); if (policy.isFile() || path.isEmpty()) { return PathUtils.unixPath(path); } return PathUtils.unixPathEndingWithSeparator(path); } private  FolderLoaderUtils(); static void createFolders(Bundle bundle, File rootDir, Map<String, E> folderableMap); }
FolderLoaderUtils { static String getPath(final File policy, final File policyRootDir) { String path = policyRootDir.toURI().relativize(policy.toURI()).getPath(); if (policy.isFile() || path.isEmpty()) { return PathUtils.unixPath(path); } return PathUtils.unixPathEndingWithSeparator(path); } private  FolderLoaderUtils(); static void createFolders(Bundle bundle, File rootDir, Map<String, E> folderableMap); static final String SOAP_RESOURCES_FOLDER; }