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