graveyard/tools/org/apache/axis/tools/trace/TraceInstrumentor.java
/**
	 * This method is called by the DirectoryTree with two files: the
	 * input (source) file and the output (target) file. This method parses 
	 * the source file and writes out the target files with trace in it.
	 * The depth is how deep in the source directory tree we are. Files are
	 * excluded if they are listed in the configuration because they shouldn't
	 * have trace added to them.
	 */
This method is called by the DirectoryTree with two files: the
input (source) file and the output (target) file. This method parses
the source file and writes out the target files with trace in it.
The depth is how deep in the source directory tree we are. Files are
excluded if they are listed in the configuration because they shouldn't
have trace added to them.
This method is called by the DirectoryTree with two files : the input ( source ) file and the output ( target ) file . This method parses the source file and writes out the target files with trace in it . The depth is how deep in the source directory tree we are . Files are excluded if they are listed in the configuration because they shouldn ' t have trace added to them .
public void actOnFile(File source, File target, int depth)
		throws Exception {
		String sourceName = source.getName();
		int dot = sourceName.lastIndexOf(".");
		String ext = new String();
		if (-1 != dot)
			ext = sourceName.substring(dot + 1);
		String targetName =
			DirectoryTree.maybeAppendSeparator(target.toString());
		File outputFile = new File(targetName + sourceName);
		if (cExtensions.contains(ext)
			&& !Configuration.fileExcluded(sourceName)) {
			Utils.outputDebugString("parsing " + source + "...");
			Tracer output =
				new Tracer(new FileWriter(outputFile, false), depth, headers);
			FileReader fr = new FileReader(source);
			BufferedReader inputFile = new BufferedReader(fr);
			try {
				parseFile(
					new InputCppSourceCode(inputFile, source.getName()),
					output);
			} catch (ParsingException pe) {
				failed = true;
			}
			output.flush();
			output.close();
			inputFile.close();
		} else {
			System.out.println("excluding file " + source);
			FileInputStream fis = new FileInputStream(source);
			FileOutputStream fos = new FileOutputStream(outputFile);
			int b = fis.read();
			while (-1 != b) {
				fos.write(b);
				b = fis.read();
			}
		}
	}
public void actOnFile ( File source , File target , int depth ) throws Exception { String sourceName = source . getName ( ) ; int dot = sourceName . lastIndexOf ( "." ) ; String ext = new String ( ) ; if ( - 1 != dot ) ext = sourceName . substring ( dot + 1 ) ; String targetName = DirectoryTree . maybeAppendSeparator ( target . toString ( ) ) ; File outputFile = new File ( targetName + sourceName ) ; if ( cExtensions . contains ( ext ) && ! Configuration . fileExcluded ( sourceName ) ) { Utils . outputDebugString ( "parsing " + source + "..." ) ; Tracer output = new Tracer ( new FileWriter ( outputFile , false ) , depth , headers ) ; FileReader fr = new FileReader ( source ) ; BufferedReader inputFile = new BufferedReader ( fr ) ; try { parseFile ( new InputCppSourceCode ( inputFile , source . getName ( ) ) , output ) ; } catch ( ParsingException pe ) { failed = true ; } output . flush ( ) ; output . close ( ) ; inputFile . close ( ) ; } else { System . out . println ( "excluding file " + source ) ; FileInputStream fis = new FileInputStream ( source ) ; FileOutputStream fos = new FileOutputStream ( outputFile ) ; int b = fis . read ( ) ; while ( - 1 != b ) { fos . write ( b ) ; b = fis . read ( ) ; } } }
This method is called by the DirectoryTree with two files: the
 input (source) file and the output (target) file.
This method is called by the DirectoryTree with two files : the input ( source ) file and the output ( target ) file .
// create a tracer to the output file 
 // OK, now we have the output file let's read in the input file !
