InterruptedException, OperationExecutionException {
if (filter != null && !filter.accept(from)) {
return;
}
if (from.isFile()) {
Put p = new Put(from, to);
perform(p);
} else if (from.isDirectory()) {
mkdir(to);
for (File f : from.listFiles()) {
put(f, new File(to, f.getName()), filter);