public class DirSync
extends Object
Modifier and Type | Field and Description |
---|---|
private SubDirFilter |
filter |
private static int |
MAX_RSYNC_BATCH |
static int |
MAX_SELECTIVE_SYNC |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int MAX_SELECTIVE_SYNC
private static final int MAX_RSYNC_BATCH
private SubDirFilter filter
public DirSync()
public DirSync(SubDirFilter filter)
public void syncDirs(File srcDir, File dstDir) throws IOException
srcDir
- Directory to matchdstDir
- Directory to modifyIOException
- If anything goes wrongprivate void selectiveSync(File srcDir, File dstDir) throws IOException
srcDir
- Directory to matchdstDir
- Directory to modifyIOException
- 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