com.guiffy.inside
Class GuiffyFileTreeDiff

java.lang.Object
  extended by com.guiffy.inside.GuiffyFileTreeDiff

public class GuiffyFileTreeDiff
extends java.lang.Object

Class GuiffyFileTreeDiff is a GuiffyDiff post processor for folder/file tree compare applications.

Example code :
The following instantiates a GuiffyDiff object with all its properties set to default. Here we also instantiate the PipedWriter for GuiffyDiff, instantiate the PipedReader and connect it to the PipedWriter.

import com.guiffy.inside.*;
      ...
      PipedWriter jifOutPipe = new PipedWriter( );
      PipedReader jifInpPipe = new PipedReader(jifOutPipe);
      GuiffyDiff jiffer = new GuiffyDiff( jifOutPipe );
Then, we set GuiffyDiff's properties(at least the 2 foldernames).
          jiffer.set1stFolder(firFoldName);
          jiffer.set2ndFolder(secFoldName);
Then, we run GuiffyDiff and pass the output in the Pipe to GuiffyFileTreeDiff.
      jiffer.start();

      GuiffyFileTreeDiff ftD = new GuiffyFileTreeDiff();
      int ftDstatus = ftD.readDiffPipe(jifInpPipe);
      if( ftDstatus != GuiffyFileTreeDiff.OK) {
        System.err.println("FileTreeDiff error= status = " + ftDstatus);
        System.exit(ftDstatus);
      }

      int rstat = jiffer.getStatus();

      if (rstat != GuiffyDiff.OK) {
          System.err.println( "Jiff error: GuiffyDiff status = " + rstat);
          System.exit(rstat);
      }
Then, we get the Lists for files Matching, Deleted, Added, Changed and print them.
      List matFiles = ftD.getMatchingFiles();
      System.out.println("====================");
      System.out.println(matFiles.size() + " Matching Files:");
      for(String fns : matFiles) {
        System.out.println(fns);
      }

      List delFiles = ftD.getDeletedFiles();
      System.out.println("<<<<<<<<<<<<<<<<<<<<");
      System.out.println(delFiles.size() + " Deleted Files:");
      for(String fns : delFiles) {
        System.out.println(fns);
      }

      List addFiles = ftD.getAddedFiles();
      System.out.println(">>>>>>>>>>>>>>>>>>>>");
      System.out.println(addFiles.size() + " Added Files:");
      for(String fns : addFiles) {
        System.out.println(fns);
      }

      List chaFiles = ftD.getChangedFiles();
      System.out.println("<><><><><><><><><><>");
      System.out.println(chaFiles.size() + " Changed Files:");
      for(String fns : chaFiles) {
        System.out.println(fns);
      }

Version:
11.5 -- developed in June, 2016
Author:
Guiffy Software, Inc. by Bill Ritcher
See Also:
Thread, PipedWriter, PipedReader

Field Summary
static int ERRORIS_EXCEPTION
           
static int OK
           
 
Constructor Summary
GuiffyFileTreeDiff()
           
 
Method Summary
 java.util.List<java.lang.String> getAddedFiles()
          Returns List of Added files.
 java.util.List<java.lang.String> getChangedFiles()
          Returns List of Changed files.
 java.util.List<java.lang.String> getDeletedFiles()
          Returns List of Deleted files.
 java.util.List<java.lang.String> getMatchingFiles()
          Returns List of Matching files.
 int readDiffPipe(java.io.PipedReader jifInpPipe)
          Read Diff Pipe (PipedReader) generated by GuiffyDiff for a folder/filetree compare.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

ERRORIS_EXCEPTION

public static final int ERRORIS_EXCEPTION
See Also:
Constant Field Values
Constructor Detail

GuiffyFileTreeDiff

public GuiffyFileTreeDiff()
Method Detail

readDiffPipe

public int readDiffPipe(java.io.PipedReader jifInpPipe)
Read Diff Pipe (PipedReader) generated by GuiffyDiff for a folder/filetree compare.

Parameters:
jifInpPipe - the Diff Pipe (PipedReader) from GuiffyDiff.
Returns:
the int value that indicates the status:
   OK = 0;
   ERRORIS_EXCEPTION = 8;    // Exception

getMatchingFiles

public java.util.List<java.lang.String> getMatchingFiles()
Returns List of Matching files.

Returns:
a List of the Matching files.

getDeletedFiles

public java.util.List<java.lang.String> getDeletedFiles()
Returns List of Deleted files.

Returns:
a List of the Deleted files.

getAddedFiles

public java.util.List<java.lang.String> getAddedFiles()
Returns List of Added files.

Returns:
a List of the Added files.

getChangedFiles

public java.util.List<java.lang.String> getChangedFiles()
Returns List of Changed files.

Returns:
a List of the Changed files.