@Override public Project resolveParentProject(final Path resource) { try { //Null resource paths cannot resolve to a Project if (resource == null) { return null; } //Check if resource is the project root org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); if (hasPom(path)) { final Path projectRootPath = Paths.convert(path); return new Project(projectRootPath, Paths.convert(path.resolve(POM_PATH)), projectRootPath.getFileName()); } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Module resolveParentModule(final Path resource) { try { //Null resource paths cannot resolve to a Module if (resource == null) { return null; } //Check if resource is the module root final org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); if (hasPom(path)) { final Path moduleRootPath = Paths.convert(path); final Path pomXMLPath = Paths.convert(path.resolve(POM_PATH)); final POM pom = pomService.load(pomXMLPath); return new Module(moduleRootPath, pomXMLPath, pom); } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Module resolveParentModule(final Path resource) { try { //Null resource paths cannot resolve to a Module if (resource == null) { return null; } //Check if resource is the module root final org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); if (hasPom(path)) { final Path moduleRootPath = Paths.convert(path); final Path pomXMLPath = Paths.convert(path.resolve(POM_PATH)); final POM pom = pomService.load(pomXMLPath); return new Module(moduleRootPath, pomXMLPath, pom); } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Module resolveToParentModule(final Path resource) { try { //Null resource paths cannot resolve to a Module if (resource == null) { return null; } //Check if resource is the module root org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); org.uberfire.java.nio.file.Path parentPomPath = path.resolve(POM_PATH); if (hasPom(path)) { POM parent = pomService.load(Paths.convert(parentPomPath)); final Path moduleRootPath = Paths.convert(path); Module module = new Module(moduleRootPath, Paths.convert(parentPomPath), parent, parent.getModules()); return module; } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Module resolveToParentModule(final Path resource) { try { //Null resource paths cannot resolve to a Module if (resource == null) { return null; } //Check if resource is the module root org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); org.uberfire.java.nio.file.Path parentPomPath = path.resolve(POM_PATH); if (hasPom(path)) { POM parent = pomService.load(Paths.convert(parentPomPath)); final Path moduleRootPath = Paths.convert(path); Module module = new Module(moduleRootPath, Paths.convert(parentPomPath), parent, parent.getModules()); return module; } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Project resolveToParentProject(final Path resource) { try { //Null resource paths cannot resolve to a Project if (resource == null) { return null; } //Check if resource is the project root org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize(); org.uberfire.java.nio.file.Path parentPomPath = path.resolve(POM_PATH); if (hasPom(path)) { POM parent = pomService.load(Paths.convert(parentPomPath)); final Path projectRootPath = Paths.convert(path); Project project = new Project(projectRootPath, Paths.convert(parentPomPath), projectRootPath.getFileName(), parent.getModules()); return project; } else { return null; } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }