ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: svn commit: r579266 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ssh: ScpFromMessage.java ScpFromMessageBySftp.java ScpToMessage.java ScpToMessageBySftp.java
Date Wed, 26 Sep 2007 06:58:44 GMT
What about pulling the HUNDRED_KILOBYTES constant to AbstractSshMessage and make it protected?
Or using a utility class holding these constants?

Jan

>-----Urspr√ľngliche Nachricht-----
>Von: peterreilly@apache.org [mailto:peterreilly@apache.org] 
>Gesendet: Dienstag, 25. September 2007 16:39
>An: ant-cvs@apache.org
>Betreff: svn commit: r579266 - in 
>/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional
>/ssh: ScpFromMessage.java ScpFromMessageBySftp.java 
>ScpToMessage.java ScpToMessageBySftp.java
>
>Author: peterreilly
>Date: Tue Sep 25 07:38:40 2007
>New Revision: 579266
>
>URL: http://svn.apache.org/viewvc?rev=579266&view=rev
>Log:
>magic number
>
>Modified:
>    
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessage.java
>    
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessageBySftp.java
>    
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessage.java
>    
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessageBySftp.java
>
>Modified: 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessage.java
>URL: 
>http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache
>/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java?rev=579266
>&r1=579265&r2=579266&view=diff
>===============================================================
>===============
>--- 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessage.java (original)
>+++ 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessage.java Tue Sep 25 07:38:40 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/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessageBySftp.java
>URL: 
>http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache
>/tools/ant/taskdefs/optional/ssh/ScpFromMessageBySftp.java?rev=
>579266&r1=579265&r2=579266&view=diff
>===============================================================
>===============
>--- 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessageBySftp.java (original)
>+++ 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpFromMessageBySftp.java Tue Sep 25 07:38:40 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/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessage.java
>URL: 
>http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache
>/tools/ant/taskdefs/optional/ssh/ScpToMessage.java?rev=579266&r
>1=579265&r2=579266&view=diff
>===============================================================
>===============
>--- 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessage.java (original)
>+++ 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessage.java Tue Sep 25 07:38:40 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/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessageBySftp.java
>URL: 
>http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache
>/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java?rev=57
>9266&r1=579265&r2=579266&view=diff
>===============================================================
>===============
>--- 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessageBySftp.java (original)
>+++ 
>ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/
>ssh/ScpToMessageBySftp.java Tue Sep 25 07:38:40 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
>
>

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


Mime
View raw message