org.rhq.core.pc.drift
Class SnapshotGenerator

java.lang.Object
  extended by org.apache.commons.io.DirectoryWalker
      extended by org.rhq.core.pc.drift.SnapshotGenerator

public class SnapshotGenerator
extends org.apache.commons.io.DirectoryWalker


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.io.DirectoryWalker
org.apache.commons.io.DirectoryWalker.CancelException
 
Constructor Summary
SnapshotGenerator()
           
 
Method Summary
 SnapshotHandle generateSnapshot(int resourceId, File basedir)
          Generates snapshot data and meta data files for the specified resource id starting at basedir.
protected  boolean handleDirectory(File directory, int depth, Collection results)
           
protected  void handleFile(File file, int depth, Collection results)
           
 void setSnapshotDir(File dir)
           
 
Methods inherited from class org.apache.commons.io.DirectoryWalker
checkIfCancelled, handleCancelled, handleDirectoryEnd, handleDirectoryStart, handleEnd, handleIsCancelled, handleRestricted, handleStart, walk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnapshotGenerator

public SnapshotGenerator()
Method Detail

setSnapshotDir

public void setSnapshotDir(File dir)
Parameters:
dir - The directory to which snapshot files will be written.

generateSnapshot

public SnapshotHandle generateSnapshot(int resourceId,
                                       File basedir)
                                throws IOException
Generates snapshot data and meta data files for the specified resource id starting at basedir. The files are written to the directory specified in setSnapshotDir(java.io.File). The files are currently stored as snapshot_dir/-snapshot.zip and snapshot_dir/_snapshot_metadata.txt.

Parameters:
resourceId - The id of the resource for which the snapshot is being created
basedir - The root directory from which the snapshot will be taken
Returns:
A SnapshotHandle that points the generated files on disk.
Throws:
IOException - If any errors occur

handleDirectory

protected boolean handleDirectory(File directory,
                                  int depth,
                                  Collection results)
                           throws IOException
Overrides:
handleDirectory in class org.apache.commons.io.DirectoryWalker
Throws:
IOException

handleFile

protected void handleFile(File file,
                          int depth,
                          Collection results)
                   throws IOException
Overrides:
handleFile in class org.apache.commons.io.DirectoryWalker
Throws:
IOException


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.