download ListAllFiles.java
Language: Java
License: GPL
LOC: 28
Project Info
Jipe
Server: SourceForge
Type: cvs
...\j\jipe\jipe\jipe\src\jipe\
   BoxComment.java
   BrowserLauncher.java
   ClassBrowser.java
   ClassFilter.java
   DeleteLine.java
   Editor.java
   ExtensionFilter.java
   Find.java
   FindInFiles.java
   HelpConsole.java
   HtmlFilter.java
   IDEOptions.java
   JarFileManager.java
   JavaFilter.java
   JavaOptions.java
   Jipe.java
   JipeCodeCompleter.java
   JipeCompiler.java
   JipeConsole.java
   JipeDecompiler.java
   JipeMethodFinder.java
   JipeProjectManager.java
   JipeUtilities.java
   JSBeautifier.java
   JSFormatter.java
   JSLineBreaker.java
   JspFilter.java
   LeftIndent.java
   ListAllFiles.java
   MasterFilter.java
   Print.java
   PrintManager.java
   ProjectFilter.java
   PropertiesManager.java
   RemoveSpaces.java
   RightIndent.java
   SimpleComment.java
   SpecialFileFilters.java
   StatusBar.java
   StringParser.java
   TextFilter.java
   ToLowerCase.java
   ToUpperCase.java
   WingComment.java

/**
 * ListAllFiles.java - ListAllFiles class for use with the Jipe Project. 
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package jipe;

import java.io.*;
import java.util.*;

public class ListAllFiles{

    Vector filevector;
    String rootdirectory = new String();
    MasterFilter filter;

    public ListAllFiles(String rootdirectory, String ext){
        this.rootdirectory = rootdirectory;
        filter = new MasterFilter(ext);
        filevector = new Vector();
        getList(rootdirectory);
    }

    public void getList(String path){	//recursively descend into each subdirectory
        String[] filelist;
        File startfile = new File(path);
        filelist = startfile.list(filter);//Gets the File array of files with no extension (directories)
        for (int i=0;i<filelist.length;i++){	// or given extension
        	File newfile=new File(path+System.getProperty("file.separator")+filelist[i]);
            if (newfile.isDirectory()){
                getList(newfile.getPath());		//gets the files within that subdirectory
            }
            else {
                filevector.addElement(newfile);
            }
        }
    }
}

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us