1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.maven.wagon;
17
18 import org.kuali.common.aws.s3.SimpleFormatter;
19
20
21
22
23
24
25
26
27 public class TransferTracker {
28 long initiated;
29 long started;
30 long completed;
31 int byteCount;
32 SimpleFormatter formatter = new SimpleFormatter();
33
34 public long getInitiated() {
35 return initiated;
36 }
37
38 public void setInitiated(long initiated) {
39 this.initiated = initiated;
40 }
41
42 public long getStarted() {
43 return started;
44 }
45
46 public void setStarted(long started) {
47 this.started = started;
48 }
49
50 public long getCompleted() {
51 return completed;
52 }
53
54 public void setCompleted(long completed) {
55 this.completed = completed;
56 }
57
58 public int getByteCount() {
59 return byteCount;
60 }
61
62 public void setByteCount(int byteCount) {
63 this.byteCount = byteCount;
64 }
65
66 @Override
67 public String toString() {
68 long elapsed = completed - started;
69 StringBuffer sb = new StringBuffer();
70 sb.append("[" + formatter.getTime(elapsed));
71 sb.append(", " + formatter.getSize(byteCount));
72 sb.append(", " + formatter.getRate(elapsed, byteCount));
73 sb.append("]");
74 return sb.toString();
75 }
76 }