use of org.syncany.plugins.transfer.to.ActionTO in project syncany by syncany.
the class RemoteTransaction method gatherTransactionStats.
/**
* This method gathers the total number of files and size that is to be uploaded.
*
* This is used in displays to the user.
*/
private TransactionStats gatherTransactionStats() {
TransactionStats stats = new TransactionStats();
for (ActionTO action : transactionTO.getActions()) {
if (action.getType().equals(ActionType.UPLOAD)) {
if (action.getStatus().equals(ActionStatus.UNSTARTED)) {
stats.totalUploadFileCount++;
stats.totalUploadSize += action.getLocalTempLocation().length();
}
}
}
return stats;
}
use of org.syncany.plugins.transfer.to.ActionTO in project syncany by syncany.
the class RemoteTransaction method upload.
/**
* Adds a file to this transaction. Generates a temporary file to store it.
*/
public void upload(File localFile, RemoteFile remoteFile) throws StorageException {
TempRemoteFile temporaryRemoteFile = new TempRemoteFile(remoteFile);
logger.log(Level.INFO, "- Adding file to TX for UPLOAD: " + localFile + " -> Temp. remote file: " + temporaryRemoteFile + ", final location: " + remoteFile);
ActionTO action = new ActionTO();
action.setType(ActionType.UPLOAD);
action.setLocalTempLocation(localFile);
action.setRemoteLocation(remoteFile);
action.setRemoteTempLocation(temporaryRemoteFile);
transactionTO.addAction(action);
}
Aggregations