graveyard/tools/org/apache/axis/tools/common/DirectoryTree.java
/**
     * Starts adding trace into the given file. If the given file is a directory
     * then this the starting directory and all code beneath and in this
     * directory will be given trace.
     * 
     * @param source - either the starting directory or one file to add trace
     *            to.
     */
Starts adding trace into the given file. If the given file is a directory
then this the starting directory and all code beneath and in this
directory will be given trace.

@param source - either the starting directory or one file to add trace
to.
Starts adding trace into the given file . If the given file is a directory then this the starting directory and all code beneath and in this directory will be given trace . @param source - either the starting directory or one file to add trace to .
public void walkTree(File source, File target, int depth) throws Exception
    {
        depth++;
        boolean noTarget=(null==target);
        if (!source.canRead( ))
            Utils.rude("Cannot read from source directory "+source);
        if (!noTarget&&!target.canWrite( ))
            Utils.rude("Cannot write to target directory "+target);
        if (source.isDirectory( ))
        {
            if(source.toString().indexOf(".svn")==-1 && source.toString().indexOf("apache1_3")==-1 && source.toString().indexOf("apache2_0")==-1)
            {
            File[] filesInDirectory=source.listFiles( );
            for(int i=0; i<filesInDirectory.length; i++)
            {
                File file=filesInDirectory[i];
                String name=file.getName( );
                int dot=name.lastIndexOf('.');
                String ext=null;
                if (-1!=dot)
                    ext=name.substring(dot+1);
                if (file.isDirectory( ) && !name.equals(".svn") && !name.equals("apache1_3") && !name.equals("apache2_0"))
                {
                    File newTarget=null;
                    if (!noTarget)
                    {
                        StringTokenizer st=new StringTokenizer(file.getPath( ),
                                "\\/");
                        String newdir=null;
                        while (st.hasMoreTokens( ))
                            newdir=st.nextToken( );
                        String targetName=maybeAppendSeparator(target
                                .toString( ));
                        newTarget=new File(targetName+newdir);
                        if (!newTarget.mkdir( ))
                            Utils.rude("Failed to create target directory "
                                    +newTarget);
                    }
                    walkTree(file, newTarget, depth);
                }
                else
                {
                    if (file.isFile( )
                            &&(extensions==null||(!file.isHidden( )&&extensions
                                    .contains(ext))))
                    {
                        actor.actOnFile(file, target, depth);
                    }
                }
            }
            }
            else
            {
                System.out.println( "Not walking "+source.toString());
            }
        }
        else
        {
            actor.actOnFile(source, target, depth);
        }
    }
public void walkTree ( File source , File target , int depth ) throws Exception { depth ++ ; boolean noTarget = ( null == target ) ; if ( ! source . canRead ( ) ) Utils . rude ( "Cannot read from source directory " + source ) ; if ( ! noTarget && ! target . canWrite ( ) ) Utils . rude ( "Cannot write to target directory " + target ) ; if ( source . isDirectory ( ) ) { if ( source . toString ( ) . indexOf ( ".svn" ) == - 1 && source . toString ( ) . indexOf ( "apache1_3" ) == - 1 && source . toString ( ) . indexOf ( "apache2_0" ) == - 1 ) { File [ ] filesInDirectory = source . listFiles ( ) ; for ( int i = 0 ; i < filesInDirectory . length ; i ++ ) { File file = filesInDirectory [ i ] ; String name = file . getName ( ) ; int dot = name . lastIndexOf ( '.' ) ; String ext = null ; if ( - 1 != dot ) ext = name . substring ( dot + 1 ) ; if ( file . isDirectory ( ) && ! name . equals ( ".svn" ) && ! name . equals ( "apache1_3" ) && ! name . equals ( "apache2_0" ) ) { File newTarget = null ; if ( ! noTarget ) { StringTokenizer st = new StringTokenizer ( file . getPath ( ) , "\\/" ) ; String newdir = null ; while ( st . hasMoreTokens ( ) ) newdir = st . nextToken ( ) ; String targetName = maybeAppendSeparator ( target . toString ( ) ) ; newTarget = new File ( targetName + newdir ) ; if ( ! newTarget . mkdir ( ) ) Utils . rude ( "Failed to create target directory " + newTarget ) ; } walkTree ( file , newTarget , depth ) ; } else { if ( file . isFile ( ) && ( extensions == null || ( ! file . isHidden ( ) && extensions . contains ( ext ) ) ) ) { actor . actOnFile ( file , target , depth ) ; } } } } else { System . out . println ( "Not walking " + source . toString ( ) ) ; } } else { actor . actOnFile ( source , target , depth ) ; } }
Starts adding trace into the given file.
Starts adding trace into the given file .
// we only want to look at this directory if it's not a .svn directory. // If it is then let's call this the end of the branch and return. // this is a file and we need to add trace into it !