tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1384086 - /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
Date Wed, 12 Sep 2012 19:08:35 GMT
Author: markt
Date: Wed Sep 12 19:08:35 2012
New Revision: 1384086

URL: http://svn.apache.org/viewvc?rev=1384086&view=rev
Log:
Complete the TODOs

Modified:
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1384086&r1=1384085&r2=1384086&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
Wed Sep 12 19:08:35 2012
@@ -17,6 +17,8 @@
 package org.apache.catalina.webresources;
 
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Set;
 
@@ -24,6 +26,7 @@ import org.apache.catalina.WebResource;
 import org.apache.catalina.WebResourceRoot;
 import org.apache.catalina.WebResourceRoot.ResourceSetType;
 import org.apache.catalina.WebResourceSet;
+import org.apache.catalina.util.IOTools;
 import org.apache.catalina.util.ResourceSet;
 
 public class DirResourceSet implements WebResourceSet {
@@ -113,7 +116,15 @@ public class DirResourceSet implements W
 
     @Override
     public boolean write(String path, InputStream is) {
-        // TODO Auto-generated method stub
-        return false;
+        File dest = new File(base, path);
+
+        try {
+            FileOutputStream fos = new FileOutputStream(dest);
+            IOTools.flow(is, fos);
+        } catch (IOException ioe) {
+            return false;
+        }
+
+        return true;
     }
 }



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


Mime
View raw message