Author: sagara
Date: Thu Aug 25 12:26:40 2011
New Revision: 1161536
URL: http://svn.apache.org/viewvc?rev=1161536&view=rev
Log:
Applied patch for AXIS2-5127.
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?rev=1161536&r1=1161535&r2=1161536&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
(original)
+++
axis/axis2/java/core/trunk/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
Thu Aug 25 12:26:40 2011
@@ -93,6 +93,8 @@ public class CodeGenWizard extends Wizar
private int selectedCodegenOptionType =
SettingsConstants.CODEGEN_DEFAULT_TYPE;//TODO change this
+ private static final String REFERNCE_FILE_PREFIX = "refernce:file:";
+
private static Log logger=LogFactory.getLog(CodeGenWizard.class);
@@ -546,6 +548,17 @@ public class CodeGenWizard extends Wizar
// Copies all files under srcDir to dstDir.
// If dstDir does not exist, it will be created.
public void copyDirectory(File srcDir, File dstDir) throws IOException {
+
+ // This only works if the given source directory is unavailable
+ if (!srcDir.exists()) {
+ String path =
CodegenWizardPlugin.getDefault().getBundle()
+
.getLocation().substring(REFERNCE_FILE_PREFIX.length() + 1)
+ + File.separator
+ + srcDir.getPath().substring(
+
srcDir.getPath().lastIndexOf(File.separator) + 1);
+ srcDir = new File(path);
+ }
+
if (srcDir.isDirectory()) {
if (!dstDir.exists()) {
dstDir.mkdir();