Author: heiko.braun(a)jboss.com
Date: 2009-11-24 10:13:34 -0500 (Tue, 24 Nov 2009)
New Revision: 314
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java
Log:
Copy subdirectores when creating WS deployment
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java 2009-11-24
15:12:55 UTC (rev 313)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/DeploymentBuilder.java 2009-11-24
15:13:34 UTC (rev 314)
@@ -56,12 +56,12 @@
this.war = fakeWebApp;
this.webInf = fakeWebInf;
this.wsdlDir = fakeWSDLDir;
-
+
return this;
}
public DeploymentBuilder setWSDL(File wsdl)
- {
+ {
copy(wsdl, new File(this.wsdlDir, wsdl.getName()));
// any related artifact as well (brute force, I know)
@@ -72,7 +72,11 @@
{
public boolean accept(File f)
{
- return (f.getName().endsWith(".wsdl") ||
f.getName().endsWith(".xsd"));
+ return (
+ f.getName().endsWith(".wsdl")
+ || f.getName().endsWith(".xsd")
+ || f.isDirectory()
+ );
}
};
@@ -96,17 +100,32 @@
try
{
- in = new FileInputStream(src);
- out = new FileOutputStream(dest);
+ if (src.isDirectory())
+ {
+ if (!dest.exists()) {
+ dest.mkdir();
+ }
- // Transfer bytes from in to out
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
+ String[] children = src.list();
+ for (int i=0; i<children.length; i++) {
+ copy(new File(src, children[i]),
+ new File(dest, children[i]));
+ }
+ } else {
+
+ in = new FileInputStream(src);
+ out = new FileOutputStream(dest);
+
+ // Copy the bits from instream to outstream
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
}
- in.close();
- out.close();
+
}
catch (IOException e)
{
Show replies by date