public LogicalPath getPath(final String moduleName, final Path path) { Validate.notNull(moduleName, "ModuleName required"); final PhysicalPath physicalPath = pomManagementService.getPomFromModuleName(moduleName).getPhysicalPath(path); Validate.notNull(physicalPath, "Physical path for '%s' not found", path.name()); return physicalPath.getLogicalPath(); }
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 MetadataItem get(final String metadataId) { Validate.isTrue(ProjectMetadata.isValid(metadataId), "Unexpected metadata request '%s' for this provider", metadataId); // Just rebuild on demand. We always do this as we expect // MetadataService to cache on our behalf final Pom pom = pomManagementService.getPomFromModuleName(ProjectMetadata.getModuleName(metadataId)); // Read the file, if it is available if (pom == null || !fileManager.exists(pom.getPath())) { return null; } return new ProjectMetadata(pom); }
public String getRoot(final LogicalPath modulePathId) { final Pom pom = pomManagementService.getPomFromModuleName(modulePathId.getModule()); return pom.getPhysicalPath(modulePathId.getPath()).getLocationPath(); }