Browse Source

less noisy verbose mode for <scp> by Rami Ojares

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276298 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
4041791887
1 changed files with 18 additions and 6 deletions
  1. +18
    -6
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java

+ 18
- 6
src/main/org/apache/tools/ant/taskdefs/optional/ssh/AbstractSshMessage.java View File

@@ -138,14 +138,26 @@ public abstract class AbstractSshMessage {
protected final int trackProgress(int filesize, int totalLength,
int percentTransmitted) {

int percent = (int) Math.round(Math.floor((totalLength
/ (double)filesize)
* 100));
int percent = (int) Math.round(Math.floor((totalLength /
(double)filesize) * 100));
if (percent > percentTransmitted) {
if (filesize < 1048576 && (percent % 10 != 0)) {
// do not track between tenths
if (filesize < 1048576) {
if (percent % 10 == 0) {
if (percent == 100) {
System.out.println(" 100%");
} else {
System.out.print("*");
}
}
} else {
log("" + percent + "%");
if (percent == 50) {
System.out.println(" 50%");
} else if (percent == 100) {
System.out.println(" 100%");
} else {
System.out.print(".");
}
}
}



Loading…
Cancel
Save