@Override public Path resolveSrcPackage( final Path resource ) { //Null resource paths cannot resolve to a Project if ( resource == null ) { return null; } //If Path is not within a Project we cannot resolve a package final Path projectRoot = resolveProject( resource ); if ( projectRoot == null ) { return null; } return doResolveSrcPackage( resource, projectRoot ); }
@Override public Path resolveTestPackage( final Path resource ) { //Null resource paths cannot resolve to a Project if ( resource == null ) { return null; } //If Path is not within a Project we cannot resolve a package final Path projectRoot = resolveProject( resource ); if ( projectRoot == null ) { return null; } return doResolveTestPackage( resource, projectRoot ); }
return null; final Path projectPath = resolveProject( packagePath ); if ( projectPath == null ) { return null;
@Override public Path resolvePathToPom( final Path resource ) { final Path projectPath = resolveProject( resource ); if ( projectPath == null ) { return null; } final org.kie.commons.java.nio.file.Path pom = paths.convert( projectPath ).resolve( POM_PATH ); if ( pom == null ) { return null; } return paths.convert( pom ); }
@Override public Path resolvePackage( final Path resource ) { //Null resource paths cannot resolve to a Project if ( resource == null ) { return null; } //If Path is not within a Project we cannot resolve a package final Path projectRoot = resolveProject( resource ); if ( projectRoot == null ) { return null; } //Check whether path is a Src package or a Test package Path packagePath = doResolveSrcPackage( resource, projectRoot ); if ( packagePath == null ) { packagePath = doResolveTestPackage( resource, projectRoot ); } return packagePath; }
@Override public boolean isPom( final Path resource ) { //Null resource paths cannot resolve to a Project if ( resource == null ) { return false; } //Check if path equals pom.xml final Path projectRoot = resolveProject( resource ); final org.kie.commons.java.nio.file.Path path = paths.convert( resource ).normalize(); final org.kie.commons.java.nio.file.Path pomFilePath = paths.convert( projectRoot ).resolve( POM_PATH ); return path.startsWith( pomFilePath ); }
@Override public boolean isKModule( final Path resource ) { //Null resource paths cannot resolve to a Project if ( resource == null ) { return false; } //Check if path equals kmodule.xml final Path projectRoot = resolveProject( resource ); final org.kie.commons.java.nio.file.Path path = paths.convert( resource ).normalize(); final org.kie.commons.java.nio.file.Path kmoduleFilePath = paths.convert( projectRoot ).resolve( KMODULE_PATH ); return path.startsWith( kmoduleFilePath ); }