public String getCanonicalPath(final String moduleName, final Path path, final JavaType javaType) { Validate.notNull(moduleName, "Module name is null"); return getCanonicalPath(path.getModulePathId(moduleName), javaType); }
public String getCanonicalPath(final LogicalPath path, final JavaType javaType) { return getIdentifier(path, javaType.getRelativeFileName()); }
public String getIdentifier(final LogicalPath logicalPath, final String relativePath) { Validate.notNull(logicalPath, "Path required"); Validate.notNull(relativePath, "Relative path cannot be null, although it can be empty"); String initialPath = FileUtils.getCanonicalPath(getPath(logicalPath)); initialPath = FileUtils.ensureTrailingSeparator(initialPath); return initialPath + StringUtils.strip(relativePath, File.separator); }
int longest = 0; for (final Pom pom : pomManagementService.getPoms()) { if (removeTrailingSeparator(identifier).startsWith(removeTrailingSeparator(pom.getRoot())) && removeTrailingSeparator(pom.getRoot()).length() > longest) { longest = removeTrailingSeparator(pom.getRoot()).length(); int nextLongest = 0; for (final PhysicalPath thisPhysicalPath : pom.getPhysicalPaths()) { possibleParent = possibleParent.concat(File.separator); if (removeTrailingSeparator(identifier).startsWith(possibleParent) && possibleParent.length() > nextLongest) { nextLongest = possibleParent.length();
private File getPath(final LogicalPath logicalPath) { final Pom pom = pomManagementService.getPomFromModuleName(logicalPath.getModule()); final File moduleRoot = getModuleRoot(logicalPath.getModule(), pom); final String pathRelativeToPom = logicalPath.getPathRelativeToPom(pom); return new File(moduleRoot, pathRelativeToPom); }
public String getIdentifier(final String moduleName, final Path path, final String relativePath) { return getIdentifier(LogicalPath.getInstance(path, moduleName), relativePath); }
public String getFocusedCanonicalPath(final Path path, final JavaType javaType) { return getCanonicalPath(pomManagementService.getFocusedModuleName(), path, javaType); }
public String getFocusedIdentifier(final Path path, final String relativePath) { return getIdentifier( LogicalPath.getInstance(path, pomManagementService.getFocusedModuleName()), relativePath); }