Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1)

134665 cpopa: APPSREPO-105 : Add an API to download multiple file/folders as a zip
      - test fixes to get rid of unpredictable failures
      - fixes after Gavin's OpenAPI spec review


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134674 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Constantin Popa
2017-01-20 12:57:32 +00:00
parent 79a98c1cfe
commit debae96be4
3 changed files with 148 additions and 98 deletions

View File

@@ -163,12 +163,12 @@ public class DownloadsImpl implements Downloads
{
DownloadStatus status = downloadService.getDownloadStatus(downloadNodeRef);
Download downloadInfo = new Download();
downloadInfo.setDownloadId(downloadNodeRef.getId());
downloadInfo.setDone(status.getDone());
downloadInfo.setId(downloadNodeRef.getId());
downloadInfo.setBytesAdded(status.getDone());
downloadInfo.setFilesAdded(status.getFilesAdded());
downloadInfo.setStatus(status.getStatus());
downloadInfo.setTotalFiles(status.getTotalFiles());
downloadInfo.setTotal(status.getTotal());
downloadInfo.setTotalBytes(status.getTotal());
return downloadInfo;
}

View File

@@ -36,22 +36,22 @@ import org.alfresco.service.cmr.download.DownloadStatus;
*/
public class Download
{
private String downloadId;
private String id;
private List<String> nodeIds;
private DownloadStatus.Status status;
private long done;
private long total;
private long bytesAdded;
private long totalBytes;
private long filesAdded;
private long totalFiles;
public String getDownloadId()
public String getId()
{
return downloadId;
return id;
}
public void setDownloadId(String downloadId)
public void setId(String id)
{
this.downloadId = downloadId;
this.id = id;
}
public List<String> getNodeIds()
@@ -74,24 +74,24 @@ public class Download
this.status = status;
}
public long getDone()
public long getBytesAdded()
{
return done;
return bytesAdded;
}
public void setDone(long done)
public void setBytesAdded(long bytesAdded)
{
this.done = done;
this.bytesAdded = bytesAdded;
}
public long getTotal()
public long getTotalBytes()
{
return total;
return totalBytes;
}
public void setTotal(long total)
public void setTotalBytes(long totalBytes)
{
this.total = total;
this.totalBytes = totalBytes;
}
public long getFilesAdded()
@@ -114,15 +114,16 @@ public class Download
this.totalFiles = totalFiles;
}
@Override
public String toString()
{
StringBuilder builder = new StringBuilder(150);
builder.append("Download [downloadId=").append(downloadId)
builder.append("Download [id=").append(id)
.append(", nodeIds=").append(nodeIds)
.append(", status=").append(status)
.append(", done=").append(done)
.append(", total=").append(total)
.append(", bytesAdded=").append(bytesAdded)
.append(", totalBytes=").append(totalBytes)
.append(", filesAdded=").append(filesAdded)
.append(", totalFiles=").append(totalFiles)
.append("]");