ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r579269 - in /ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh: ScpFromMessage.java ScpFromMessageBySftp.java ScpToMessage.java ScpToMessageBySftp.java
Date Tue, 25 Sep 2007 14:42:06 GMT
Author: peterreilly
Date: Tue Sep 25 07:42:06 2007
New Revision: 579269

URL: http://svn.apache.org/viewvc?rev=579269&view=rev
Log:
sync: magic number

Modified:
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
    ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java?rev=579269&r1=579268&r2=579269&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
Tue Sep 25 07:42:06 2007
@@ -34,6 +34,7 @@
  */
 public class ScpFromMessage extends AbstractSshMessage {
 
+    private static final int HUNDRED_KILOBYTES = 102400;
     private static final byte LINE_FEED = 0x0a;
     private static final int BUFFER_SIZE = 1024;
 
@@ -207,7 +208,7 @@
         long startTime = System.currentTimeMillis();
 
         // only track progress for files larger than 100kb in verbose mode
-        boolean trackProgress = getVerbose() && filesize > 102400;
+        boolean trackProgress = getVerbose() && filesize > HUNDRED_KILOBYTES;
         // since filesize keeps on decreasing we have to store the
         // initial filesize
         long initFilesize = filesize;

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java?rev=579269&r1=579268&r2=579269&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java
Tue Sep 25 07:42:06 2007
@@ -33,6 +33,8 @@
  */
 public class ScpFromMessageBySftp extends ScpFromMessage {
 
+    private static final int HUNDRED_KILOBYTES = 102400;
+
     private String remoteFile;
     private File localFile;
     private boolean isRecursive = false;
@@ -154,7 +156,7 @@
         long totalLength = le.getAttrs().getSize();
 
         SftpProgressMonitor monitor = null;
-        boolean trackProgress = getVerbose() && totalLength > 102400;
+        boolean trackProgress = getVerbose() && totalLength > HUNDRED_KILOBYTES;
         if (trackProgress) {
             monitor = getProgressMonitor();
         }

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java?rev=579269&r1=579268&r2=579269&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java
Tue Sep 25 07:42:06 2007
@@ -34,6 +34,7 @@
  */
 public class ScpToMessage extends AbstractSshMessage {
 
+    private static final int HUNDRED_KILOBYTES = 102400;
     private static final int BUFFER_SIZE = 1024;
 
     private File localFile;
@@ -234,7 +235,7 @@
         long totalLength = 0;
 
         // only track progress for files larger than 100kb in verbose mode
-        boolean trackProgress = getVerbose() && filesize > 102400;
+        boolean trackProgress = getVerbose() && filesize > HUNDRED_KILOBYTES;
         // since filesize keeps on decreasing we have to store the
         // initial filesize
         long initFilesize = filesize;

Modified: ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java
URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java?rev=579269&r1=579268&r2=579269&view=diff
==============================================================================
--- ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java
(original)
+++ ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java
Tue Sep 25 07:42:06 2007
@@ -34,6 +34,8 @@
  */
 public class ScpToMessageBySftp extends ScpToMessage/*AbstractSshMessage*/ {
 
+    private static final int HUNDRED_KILOBYTES = 102400;
+
     private File localFile;
     private String remotePath;
     private List directoryList;
@@ -205,7 +207,7 @@
         long totalLength = filesize;
 
         // only track progress for files larger than 100kb in verbose mode
-        boolean trackProgress = getVerbose() && filesize > 102400;
+        boolean trackProgress = getVerbose() && filesize > HUNDRED_KILOBYTES;
 
         SftpProgressMonitor monitor = null;
         if (trackProgress) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message