org.netbeans.modules.java.project/1 1.38.1

org.netbeans.spi.java.project.support
Class JavadocAndSourceRootDetection

java.lang.Object
  extended by org.netbeans.spi.java.project.support.JavadocAndSourceRootDetection

public class JavadocAndSourceRootDetection
extends Object

Miscellaneous helper utils to detect Javadoc root folder, source root folder or package of the given java or class file.

Since:
org.netbeans.modules.java.project/1 1.20

Method Summary
static FileObject findJavadocRoot(FileObject baseFolder)
          Finds Javadoc root inside of given folder.
static FileObject findPackageRoot(FileObject fo)
          Returns package root of the given java or class file.
static FileObject findSourceRoot(FileObject fo)
          Finds Java sources root inside of given folder.
static Set<? extends FileObject> findSourceRoots(FileObject folder, AtomicBoolean canceled)
          Finds Java sources roots inside of given folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findJavadocRoot

public static FileObject findJavadocRoot(FileObject baseFolder)
Finds Javadoc root inside of given folder.

Parameters:
fo - base folder to start search in; routine will traverse 5 folders deep before giving up; cannot be null; must be folder
Returns:
found Javadoc root or null if none found

findSourceRoot

public static FileObject findSourceRoot(FileObject fo)
Finds Java sources root inside of given folder.

Parameters:
fo - base folder to start search in; routine will traverse subfolders to find a Java file to detect package root; cannot be null; must be folder
Returns:
found package root of first Java file found or null if none found

findSourceRoots

public static Set<? extends FileObject> findSourceRoots(@NonNull
                                                        FileObject folder,
                                                        @NullAllowed
                                                        AtomicBoolean canceled)
Finds Java sources roots inside of given folder.

Parameters:
folder - to start search in; routine will traverse subfolders to find a Java file to detect package root; cannot be null; must be folder
canceled - if set to true the method immediately returns roots it has already found, may be null
Returns:
Collection of found package roots
Since:
1.31

findPackageRoot

public static FileObject findPackageRoot(FileObject fo)
Returns package root of the given java or class file.

Parameters:
fo - either .java or .class file; never null
Returns:
package root of the given file or null if none found

org.netbeans.modules.java.project/1 1.38.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.