public String getFocusedRoot(final Path path) { return pomManagementService.getFocusedModule().getPathLocation(path); }
private File getModuleRoot(final String module, final Pom pom) { if (pom == null) { // No POM exists for this module; we must be creating it return new File(pomManagementService.getFocusedModule().getRoot(), module); } // This is a known module; use its known root path return new File(pom.getRoot()); }
public LogicalPath getFocusedPath(final Path path) { final PhysicalPath physicalPath = pomManagementService.getFocusedModule().getPhysicalPath(path); Validate.notNull(physicalPath, "Physical path for '%s' not found", path.name()); return physicalPath.getLogicalPath(); }
private void updateParentModulePom(final String moduleName) { final String parentPomPath = pomManagementService.getFocusedModule().getPath(); final Document parentPomDocument = XmlUtils.readXml(fileManager.getInputStream(parentPomPath)); final Element parentPomRoot = parentPomDocument.getDocumentElement(); DomUtils.createChildIfNotExists("packaging", parentPomRoot, parentPomDocument).setTextContent( "pom"); addModuleDeclaration(moduleName, parentPomDocument, parentPomRoot); final String addModuleMessage = getDescriptionOfChange(ADDED, Collections.singleton(moduleName), "module", "modules"); fileManager.createOrUpdateTextFileIfRequired(getFocusedModule().getPath(), XmlUtils.nodeToString(parentPomDocument), addModuleMessage, false); }