for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioProjectRootPath.resolve(src); packageNames.addAll(getPackageNames(nioProjectRootPath, nioPackageRootSrcPath, true,
for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src); packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, true,
for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src); packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, true,
packageNames.addAll(getPackageNames(nioProjectRootPath, nioPackageRootSrcPath, false,
for (org.uberfire.java.nio.file.Path nioChildPackageSrcPath : nioChildPackageSrcPaths) { if (recursive) { packageNames.addAll(getPackageNames(nioModuleRootPath, nioChildPackageSrcPath, includeDefault,
@Override public org.guvnor.common.services.project.model.Package resolveDefaultPackage(final Project project) { final Set<String> packageNames = new HashSet<String>(); if (project == null) { return null; } //Build a set of all package names across /src/main/java, /src/main/resources, /src/test/java and /src/test/resources paths //It is possible (if the project was not created within the workbench that some packages only exist in certain paths) final Path projectRoot = project.getRootPath(); final org.uberfire.java.nio.file.Path nioProjectRootPath = Paths.convert(projectRoot); for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioProjectRootPath.resolve(src); packageNames.addAll(getPackageNames(nioProjectRootPath, nioPackageRootSrcPath, true, true, false)); } //Construct Package objects for each package name final java.util.Set<String> resolvedPackages = new java.util.HashSet<String>(); for (String packagePathSuffix : packageNames) { for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackagePath = nioProjectRootPath.resolve(src).resolve(packagePathSuffix); if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) { return resolvePackage(Paths.convert(nioPackagePath)); } } } return null; }
packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, false,
for (org.uberfire.java.nio.file.Path nioChildPackageSrcPath : nioChildPackageSrcPaths) { if (recursive) { packageNames.addAll(getPackageNames(nioModuleRootPath, nioChildPackageSrcPath, includeDefault,
for (org.uberfire.java.nio.file.Path nioChildPackageSrcPath : nioChildPackageSrcPaths) { if (recursive) { packageNames.addAll(getPackageNames(nioProjectRootPath, nioChildPackageSrcPath, includeDefault,
@Override public org.guvnor.common.services.project.model.Package resolveDefaultPackage(final Module module) { final Set<String> packageNames = new HashSet<>(); if (module == null) { return null; } //Build a set of all package names across /src/main/java, /src/main/resources, /src/test/java and /src/test/resources paths //It is possible (if the module was not created within the workbench that some packages only exist in certain paths) final Path moduleRoot = module.getRootPath(); final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(moduleRoot); for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src); packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, true, true, false)); } //Construct Package objects for each package name final java.util.Set<String> resolvedPackages = new java.util.HashSet<>(); for (String packagePathSuffix : packageNames) { for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackagePath = nioModuleRootPath.resolve(src).resolve(packagePathSuffix); if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) { return resolvePackage(Paths.convert(nioPackagePath)); } } } return null; }
packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, false,
@Override public org.guvnor.common.services.project.model.Package resolveDefaultPackage(final Module module) { final Set<String> packageNames = new HashSet<>(); if (module == null) { return null; } //Build a set of all package names across /src/main/java, /src/main/resources, /src/test/java and /src/test/resources paths //It is possible (if the module was not created within the workbench that some packages only exist in certain paths) final Path moduleRoot = module.getRootPath(); final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(moduleRoot); for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src); packageNames.addAll(getPackageNames(nioModuleRootPath, nioPackageRootSrcPath, true, true, false)); } //Construct Package objects for each package name final java.util.Set<String> resolvedPackages = new java.util.HashSet<>(); for (String packagePathSuffix : packageNames) { for (String src : SOURCE_PATHS) { final org.uberfire.java.nio.file.Path nioPackagePath = nioModuleRootPath.resolve(src).resolve(packagePathSuffix); if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) { return resolvePackage(Paths.convert(nioPackagePath)); } } } return null; }
packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageMainSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageMainResourcesPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageTestSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageTestResourcesPath()).getParent(), true,
packageNames.addAll(getPackageNames(nioProjectRootPath, Paths.convert(pkg.getPackageMainSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioProjectRootPath, Paths.convert(pkg.getPackageMainResourcesPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioProjectRootPath, Paths.convert(pkg.getPackageTestSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioProjectRootPath, Paths.convert(pkg.getPackageTestResourcesPath()).getParent(), true,
packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageMainSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageMainResourcesPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageTestSrcPath()).getParent(), true, false, false)); packageNames.addAll(getPackageNames(nioModuleRootPath, Paths.convert(pkg.getPackageTestResourcesPath()).getParent(), true,