package eloquent;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.List;

import eloquent.exceptions.EloquentException;
import eloquent.models.File;
import eloquent.adapters.AdapterInterface;

public class BatchTransfer {

	protected Queue<String> paths;

	protected List<File> files;

	protected AdapterInterface toAdapter;

	protected AdapterInterface fromAdapter;

	public BatchTransfer() {

		this.paths = new LinkedList<>();
		this.files = new ArrayList<>();
	}

	public BatchTransfer(List<String> filePaths) {
		super();

		for (String path : filePaths) {
			this.add(path);
		}
	}

	public BatchTransfer add(String path) {
		this.paths.add(path);

		return this;
	}

	public BatchTransfer to(AdapterInterface toAdapter) {
		this.toAdapter = toAdapter;

		return this;
	}

	public BatchTransfer from(AdapterInterface fromAdapter) {
		this.fromAdapter = fromAdapter;

		return this;
	}

	public List<File> getFiles() throws EloquentException {

		while (!this.paths.isEmpty()) {

			// Retrieve first path | HEAD
			String path = this.paths.poll();

			Transfer transfer = new Transfer(path);
			transfer.from(this.fromAdapter).to(this.toAdapter);

			try {
				File file = transfer.getFile();
				this.files.add(file);
			} catch (Exception e) {
				throw new EloquentException(e.getMessage());
			}
		}

		return this.files;
	}

}

@@ -8,24 +8,185 @@
  eloquent;%0A%0A
+import eloquent.adapters.AdapterInterface;%0Aimport eloquent.exceptions.EloquentException;%0Aimport eloquent.models.BatchTransferFile;%0Aimport eloquent.models.File;%0A%0A
 import java.
@@ -226,24 +226,47 @@
 LinkedList;%0A
+import java.util.List;%0A
 import java.
@@ -280,150 +280,8 @@
 eue;
-%0Aimport java.util.List;%0A%0Aimport eloquent.exceptions.EloquentException;%0Aimport eloquent.models.File;%0Aimport eloquent.adapters.AdapterInterface;
 %0A%0Apu
@@ -325,22 +325,33 @@
 d Queue%3C
-String
+BatchTransferFile
 %3E paths;
@@ -517,24 +517,41 @@
  LinkedList%3C
+BatchTransferFile
 %3E();%0A%09%09this.
@@ -749,27 +749,151 @@
 %7B%0A%09%09
-this.paths.add(path
+return this.add(path, path);%0A%09%7D%0A%0A%09public BatchTransfer add(String path, String newPath) %7B%0A%09%09this.paths.add(new BatchTransferFile(path, newPath)
 );%0A%0A
@@ -1258,27 +1258,46 @@
 HEAD%0A%09%09%09
-String path
+BatchTransferFile transferFile
  = this.
@@ -1347,20 +1347,38 @@
 ransfer(
-p
+transferFile.getP
 ath
+()
 );%0A%09%09%09tr
@@ -1425,16 +1425,46 @@
 Adapter)
+.at(transferFile.getNewpath())
 ;%0A%0A%09%09%09tr

Use BatchTransferFile for transferring file and allow new path