Logo Search packages:      
Sourcecode: jabref-plugin-oo version File versions  Download package

File net::sf::jabref::oo::AutoDetectPaths::findFileDir ( File  startDir,
String  filename 
) [inline]

Search for a file, starting at the given directory.

Parameters:
startDir The starting point.
filename The name of the file to search for.
Returns:
The directory where the file was first found, or null if not found.

Definition at line 280 of file AutoDetectPaths.java.

                                                            {
        if (fileSearchCancelled)
            return null;
        //System.out.println("Searching: "+startDir.getPath());
        File[] files = startDir.listFiles();
        if (files == null)
            return null;
        File result = null;
        for (int i=0; i<files.length; i++) {
            if (fileSearchCancelled)
                return null;
            if (files[i].isDirectory()) {
                result = findFileDir(files[i], filename);
                if (result != null)
                    break;
            }
            else if (files[i].getName().equals(filename)) {
                result = startDir;
                break;
            }
        }
        return result;
    }


Generated by  Doxygen 1.6.0   Back to index