You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/03/17 09:42:00 UTC

DO NOT REPLY [Bug 39009] New: - scp task: includeEmptyDirs

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