ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39009] New: - scp task: includeEmptyDirs
Date Fri, 17 Mar 2006 08:42:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39009>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39009

           Summary: scp task:  includeEmptyDirs
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: Markus.Barchfeld@dvag.com


The Scp task should support includeEmptyDirs as does the copy task.

Index:
C:/Java/ant/ant-core/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
===================================================================
---
C:/Java/ant/ant-core/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
(revision 383811)
+++
C:/Java/ant/ant-core/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
(working copy)
@@ -42,6 +42,7 @@
 
     private String fromUri;
     private String toUri;
+    private boolean includeEmptyDirs ;
     private List fileSets = null;
     private boolean isFromRemote, isToRemote;
 
@@ -319,6 +320,15 @@
         DirectoryScanner scanner = set.getDirectoryScanner(getProject());
         Directory root = new Directory(scanner.getBasedir());
         String[] files = scanner.getIncludedFiles();
+
+        if (includeEmptyDirs) {
+        	String[] dirs = scanner.getIncludedDirectories();
+        	ArrayList<String> filesAndDirList = new ArrayList<String>() ;
+        	filesAndDirList.addAll(Arrays.asList(dirs)) ;
+        	filesAndDirList.addAll(Arrays.asList(files)) ;
+        	files = filesAndDirList.toArray(new String[] {}) ;
+        }
+
         if (files.length != 0) {
             for (int j = 0; j < files.length; j++) {
                 String[] path = Directory.getPath(files[j]);
@@ -341,4 +351,12 @@
         }
         return root;
     }
+
+    public boolean getIncludeEmptyDirs() {
+		return includeEmptyDirs;
+	}
+
+    public void setIncludeEmptyDirs(boolean includeEmptyDirs) {
+		this.includeEmptyDirs = includeEmptyDirs;
+	}
 }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message