/** * Returns the repository path for the given platform one. * @param path the platform path * @param respectDotDir if {@code true}, all ".dir" are removed. * @return the repository path */ public static String getRepositoryPath(String path, boolean respectDotDir) { String[] elems = Text.explode(path, '/', true); for (int i=0; i<elems.length; i++) { if (elems[i].length() > 0) { if (respectDotDir && elems[i].endsWith(".dir")) { elems[i] = getRepositoryName(elems[i].substring(0, elems[i].length() - 4)); } else { elems[i] = getRepositoryName(elems[i]); } } } return Text.implode(elems, "/"); }
/** * Returns the repository path for the given platform one. * @param path the platform path * @return the repository path */ public static String getRepositoryPath(String path) { String[] elems = Text.explode(path, '/', true); for (int i=0; i<elems.length; i++) { if (elems[i].length() > 0) { elems[i] = getRepositoryName(elems[i]); } } return Text.implode(elems, "/"); }
public VaultFileImpl getChild(String name) throws RepositoryException { VaultFileImpl child = children == null ? null : children.get(name); if (child == null) { // try to load child String repoName = PlatformNameFormat.getRepositoryName(name); loadPendingNode(repoName); child = children == null ? null : children.get(name); // if still not present, load all if (child == null) { loadChildren(); } child = children == null ? null : children.get(name); } return child; }
Arrays.sort(files, FileNameComparator.INSTANCE); for (File childFile : files) { String childPath = parentPath + "/" + PlatformNameFormat.getRepositoryName(childFile.getName()); File file = getFile(childPath); if (file != null && pathMatches(childPath) && !childPaths.contains(childPath)) {
String repoName = PlatformNameFormat.getRepositoryName(fileName); String repoPath = parentPath + "/" + repoName; if (file.isDirectory()) {
continue; String repoName = PlatformNameFormat.getRepositoryName(fileName); String repoPath = parentInfo.path + "/" + repoName; if (repoName.endsWith(".dir")) { continue; String repoName = PlatformNameFormat.getRepositoryName(fileName); String repoPath = parentInfo.path + "/" + repoName; if (file.getName().equals(Constants.DOT_CONTENT_XML)) {
parentName = parentName.substring(0, parentName.length() - 4); repoName = PlatformNameFormat.getRepositoryName(parentName) + "/" + repoName; parentPath = Text.getRelativeParent(parentPath, 1); parent = fs.getFile(parentPath); parentName = parentName.substring(0, parentName.length() - 4); repoName = PlatformNameFormat.getRepositoryName(parentName) + "/" + repoName; parentPath = Text.getRelativeParent(parentPath, 1); parent = fs.getFile(parentPath); return false; String repoName = PlatformNameFormat.getRepositoryName(name); int idx = repoName.lastIndexOf('.'); if (idx > 0) {