AssetsControllerHelper { public String normalizePathWithoutLeadingSlash(String fileName, boolean enforceUnixSeparator) { String fileNameNormalized = enforceUnixSeparator ? FilenameUtils.normalize(fileName, true) : FilenameUtils.normalize(fileName); return StringUtils.removeStart(fileNameNormalized, "/"); }  String normalizePathWithoutLeadingSlash(String fileName, boolean enforceUnixSeparator); boolean isDirectoryURL(URL url);  }
@Test public void testNormalizePathWithoutLeadingSlash() { assertEquals("dir1/test.test", assetsControllerHelper.normalizePathWithoutLeadingSlash("/dir1/test.test", true)); assertEquals("dir1/test.test", assetsControllerHelper.normalizePathWithoutLeadingSlash("dir1/test.test", true)); assertEquals(null, assetsControllerHelper.normalizePathWithoutLeadingSlash("/../test.test", true)); assertEquals(null, assetsControllerHelper.normalizePathWithoutLeadingSlash("../test.test", true)); assertEquals("dir2/file.test", assetsControllerHelper.normalizePathWithoutLeadingSlash("/dir1/../dir2/file.test", true)); assertEquals(null, assetsControllerHelper.normalizePathWithoutLeadingSlash(null, true)); assertEquals("", assetsControllerHelper.normalizePathWithoutLeadingSlash("", true)); }