Finds story paths, using the {@link #newStoryFinder()}, in the
{@link #searchDirectory()} given specified {@link #includes} and
{@link #excludes}.

@return A List of story paths found
767241
protected List<String> storyPaths() {
        log("Searching for story paths including " + includes + " and excluding " + excludes, MSG_DEBUG);
        List<String> storyPaths = newStoryFinder().findPaths(searchDirectory(), includes, excludes);
        log("Found story paths: " + storyPaths, MSG_INFO);
        return storyPaths;
    }
1203515
private List<String> findJadeResources(final List<ResourceRef> resources) {
        List<String> urls = new LinkedList<String>();
        for (ResourceRef ref : resources) {
            if (ref.hasModifier("dao") || ref.hasModifier("DAO")) {
                try {
                    Resource resource = ref.getResource();
                    File resourceFile = resource.getFile();
                    if (resourceFile.isFile()) {
                        urls.add("jar:file:" + resourceFile.toURI().getPath()
                                + ResourceUtils.JAR_URL_SEPARATOR);
                    } else if (resourceFile.isDirectory()) {
                        urls.add(resourceFile.toURI().toString());
                    }
                } catch (IOException e) {
                    throw new ApplicationContextException("error on resource.getFile", e);
                }
            }
        }
        if (logger.isInfoEnabled()) {
            logger.info("[jade] found " + urls.size() + " jade urls: " + urls);
        }
        return urls;
    }
704784
private boolean findFiles(String[] args, String option, Set<String> suffixes,
                              Map<String,Source> found_files, Map<String, Module> found_modules,
                              Module current_module, boolean inLinksrc)
        throws ProblemException, ProblemException
    {
        // Track which source roots, source path roots and class path roots have been added.
        Set<File> roots = new HashSet<File>();
        // Track the current set of package includes,excludes as well as excluded source files,
        // to be used in the next -src/-sourcepath/-classpath
        List<String> includes = new LinkedList<String>();
        List<String> excludes = new LinkedList<String>();
        List<String> excludefiles = new LinkedList<String>();
        List<String> includefiles = new LinkedList<String>();
        // This include is used to find all modules in the source.
        List<String> moduleinfo = new LinkedList<String>();
        moduleinfo.add("module-info.java");

        for (int i = 0; i<args.length; ++i) {
            if (args[i].equals("-i")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a package pattern following -i");
                }
                String incl = args[i+1];
                checkPattern(incl);
                includes.add(incl);
            }
            if (args[i].equals("-x")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a package pattern following -x");
                }
                String excl = args[i+1];
                checkPattern(excl);
                excludes.add(excl);
            }
            if (args[i].equals("-xf")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a file following -xf");
                }
                String exclf = args[i+1];
                checkFilePattern(exclf);
                exclf = Util.normalizeDriveLetter(exclf);
                excludefiles.add(fixupSeparator(exclf));
            }
            if (args[i].equals("-if")) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a file following -xf");
                }
                String inclf = args[i+1];
                checkFilePattern(inclf);
                inclf = Util.normalizeDriveLetter(inclf);
                includefiles.add(fixupSeparator(inclf));
            }
            if (args[i].equals(option)) {
                if (i+1 >= args.length) {
                    throw new ProblemException("You have to specify a directory following "+option);
                }
                String[] root_dirs = args[i+1].split(File.pathSeparator);
                for (String r : root_dirs) {
                    File root = new File(r);
                    if (!root.isDirectory()) {
                        throw new ProblemException("\""+r+"\" is not a directory.");
                    }
                    try {
                        root = root.getCanonicalFile();
                    } catch (IOException e) {
                        throw new ProblemException(""+e);
                    }
                    if (roots.contains(root)) {
                        throw new ProblemException("\""+r+"\" has already been used for "+option);
                    }
                    if (root.equals(bin_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -d");
                    }
                    if (root.equals(gensrc_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -s");
                    }
                    if (root.equals(header_dir)) {
                        throw new ProblemException("\""+r+"\" cannot be used both for "+option+" and -h");
                    }
                    roots.add(root);
                    Source.scanRoot(root, suffixes, excludes, includes, excludefiles, includefiles,
                                    found_files, found_modules, current_module,
                                    findBooleanOption(args, "--permit-sources-without-package"),
                                    false, inLinksrc);
                }
            }
            if (args[i].equals("-src") ||
                args[i].equals("-sourcepath") ||
                args[i].equals("-modulepath") ||
                args[i].equals("-classpath") ||
                args[i].equals("-cp"))
            {
                // Reset the includes,excludes and excludefiles after they have been used.
                includes = new LinkedList<String>();
                excludes = new LinkedList<String>();
                excludefiles = new LinkedList<String>();
                includefiles = new LinkedList<String>();
            }
        }
        return true;
    }
1176528
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setExcludeClasses(final String... excludeClasses) {
        if (excludeClasses != null) {
            this.excludeClasses = Arrays.asList(excludeClasses);
        }
        return (T) this;
    }
1175915
protected List<CmsResource> getDirectPages() throws CmsException {

        List<CmsResource> result = new ArrayList<CmsResource>();
        result.addAll(getNavigationPages());
        Set<String> includeRoots = m_includeExcludeSet.getIncludeRoots();
        for (String includeRoot : includeRoots) {
            try {
                CmsResource resource = m_guestCms.readResource(includeRoot);
                if (resource.isFile()) {
                    result.add(resource);
                } else {
                    List<CmsResource> subtreeFiles = m_guestCms.readResources(
                        includeRoot,
                        CmsResourceFilter.DEFAULT_FILES,
                        true);
                    result.addAll(subtreeFiles);
                }
            } catch (CmsVfsResourceNotFoundException e) {
                LOG.warn("Could not read include resource: " + includeRoot);
            }
        }
        Iterator<CmsResource> filterIter = result.iterator();
        while (filterIter.hasNext()) {
            CmsResource currentResource = filterIter.next();
            if (currentResource.isInternal() || m_includeExcludeSet.isExcluded(currentResource.getRootPath())) {
                filterIter.remove();
            }
        }
        return result;
    }
1292440
public static ArrayList<File> getFilesInDirectoryTree(String path, FileFilterRuleSet includeRuleSet) {
		File file = new File(path);
		return getContentsInDirectoryTree(file, includeRuleSet, true, false);
	}
1333892
private List<File> getRelativeIncludeDirectories( VCProject vcProject ) throws MojoExecutionException
    {
        final List<File> relativeIncludeDirectories = new ArrayList<File>();
        
        for ( File includeDir : vcProject.getIncludeDirectories() )
        {
            if ( includeDir.isAbsolute() )
            {
                relativeIncludeDirectories.add( includeDir );
            }
            else
            {
                try
                {
                    File absoluteIncludeDir = new File ( vcProject.getFile().getParentFile(), includeDir.getPath() );
                    relativeIncludeDirectories.add( getRelativeFile( vcProject.getBaseDirectory(), 
                            absoluteIncludeDir.getCanonicalFile() ) );
                }
                catch ( IOException ioe )
                {
                    throw new MojoExecutionException( "Failed to compute relative path for directroy " + includeDir, 
                            ioe );
                }
            }
        }
        
        return relativeIncludeDirectories;
    }
534749
public Set<String> getIncludeRoots() {

        List<String> pathList = new ArrayList<String>(m_includes);
        Set<String> includeRoots = new HashSet<String>();
        Collections.sort(pathList);
        while (!pathList.isEmpty()) {
            Iterator<String> iterator = pathList.iterator();
            String firstPath = iterator.next();
            includeRoots.add(firstPath);
            iterator.remove();
            while (iterator.hasNext()) {
                String currentPath = iterator.next();
                if (CmsStringUtil.isPrefixPath(firstPath, currentPath)) {
                    iterator.remove();
                }
            }
        }
        return includeRoots;
    }
265515
private static Collection<String> findPaths(Path path)
    {
        List<String> paths = findPaths(path, false);
        Collections.sort(paths);
        return paths;
    }
1311819
public boolean isExcluded(String path) {

        path = normalizePath(path);
        List<String> pathList = new ArrayList<String>(m_allPaths);
        // m_allPaths is already sorted, we need the reverse ordering so children come before their parents
        // (we want to find the deepest parent folder of 'path' that is marked as include/exclude)
        Collections.reverse(pathList);
        for (String pathInList : pathList) {
            if (CmsStringUtil.isPrefixPath(pathInList, path)) {
                return m_excludes.contains(pathInList);
            }
        }
        return false;
    }
1175583
@Override
    public boolean include(ArchivePath path) {
        if (paths.contains(path.get())) {
            return false;
        }
        return true;
    }
789076
public Collection<Story> getChildStories(StoryFilter filter) {
        filter = (filter != null) ? filter : new StoryFilter();
        filter.epic.clear();
        filter.epic.add(this);
        return getInstance().get().story(filter);
    }
128989
@Pure
	public List<File> getSourcePaths() {
		if (this.sourcePath == null) {
			return Collections.emptyList();
		}
		return Collections.unmodifiableList(this.sourcePath);
	}
881874
public List<T> find(String... includes) throws IOException {
        return find(getWorld().filter().include(includes));
    }
843764
private function getExcludePaths(): array
    {
        $excludePaths = [];

        foreach ($this->excludePaths as $path) {
            $path = str_replace('*', '.*', $path);
            $excludePaths[] = '#' . str_replace($this->rootDirectory . '/', '', $path) . '#';
        }

        return $excludePaths;
    }
104387
@Override
  public List<String> searchedPaths() {

    List<String> searchedPaths = super.searchedPaths();
    searchedPaths.add(customVOMSESPath);
    return searchedPaths;
  }
1263817
public List<CmsTool> getToolsForPath(CmsWorkplace wp, String baseTool, boolean includeSubtools) {

        List<CmsTool> toolList = new ArrayList<CmsTool>();
        String rootKey = getCurrentRoot(wp).getKey();
        Iterator<CmsTool> itTools = m_tools.elementList().iterator();
        while (itTools.hasNext()) {
            CmsTool tool = itTools.next();
            String path = tool.getHandler().getPath();
            if (resolveAdminTool(rootKey, path) != tool) {
                continue;
            }
            if (path.equals(TOOLPATH_SEPARATOR)) {
                continue;
            }
            // leave out everything above the base
            if (!path.startsWith(baseTool)) {
                continue;
            }
            // filter for path
            if (baseTool.equals(TOOLPATH_SEPARATOR) || path.startsWith(baseTool + TOOLPATH_SEPARATOR)) {
                // filter sub tree
                if (includeSubtools || (path.indexOf(TOOLPATH_SEPARATOR, baseTool.length() + 1) < 0)) {
                    toolList.add(tool);
                }
            }
        }
        return toolList;
    }