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