|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDirSync
public class DirSync
Routines to synchronize one directory hierarchy to match another. Now uses rsync for speed and simplicity, and adds a threshold above which we avoid per-subdirectory syncing and just do the whole thing.
Field Summary | |
---|---|
private SubDirFilter |
filter
|
private static int |
MAX_RSYNC_BATCH
|
static int |
MAX_SELECTIVE_SYNC
|
Constructor Summary | |
---|---|
DirSync()
Initialize a directory syncer with no sub-directory filter (all sub-directories will be scanned.) |
|
DirSync(SubDirFilter filter)
Initialize with a sub-directory filter. |
Method Summary | |
---|---|
void |
runRsync(File src,
File dst,
List<String> subDirs,
String[] extraArgs)
Run an rsync command with the standard arguments plus the specified subdirectories and optional extra args. |
private void |
selectiveSync(File srcDir,
File dstDir)
The main workhorse of the scanner. |
void |
syncDirs(File srcDir,
File dstDir)
Sync the files from source to dest. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_SELECTIVE_SYNC
private static final int MAX_RSYNC_BATCH
private SubDirFilter filter
Constructor Detail |
---|
public DirSync()
public DirSync(SubDirFilter filter)
Method Detail |
---|
public void syncDirs(File srcDir, File dstDir) throws IOException
srcDir
- Directory to matchdstDir
- Directory to modify
IOException
- If anything goes wrongprivate void selectiveSync(File srcDir, File dstDir) throws IOException
srcDir
- Directory to matchdstDir
- Directory to modify
IOException
- If anything goes wrongpublic void runRsync(File src, File dst, List<String> subDirs, String[] extraArgs) throws IOException
src
- Directory (or file) to matchdst
- Directory (or file) to modifysubDirs
- Sub-directories to rsync (null for all)
IOException
- If anything goes wrong
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |