diff options
author | nhauge | 2010-06-30 17:11:21 +0000 |
---|---|---|
committer | nhauge | 2010-06-30 17:11:21 +0000 |
commit | d651ee54c7c3739bc88867be75af3d4a8d55feba (patch) | |
tree | 57dcc320d58771cc962066c4337ece54e8a64187 | |
parent | 4cc72884845e8037208541ae1f39028993fa35ac (diff) | |
download | webtools.dali-d651ee54c7c3739bc88867be75af3d4a8d55feba.tar.gz webtools.dali-d651ee54c7c3739bc88867be75af3d4a8d55feba.tar.xz webtools.dali-d651ee54c7c3739bc88867be75af3d4a8d55feba.zip |
312428 - handle spaces in directory names. Checking in patch for Tran.
2 files changed, 22 insertions, 7 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java index 17a36d09de..b469e47b82 100644 --- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java +++ b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java @@ -224,10 +224,24 @@ class JptSchemaOutputResolver extends SchemaOutputResolver { @Override public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException { - - File file = new File(this.targetSchemaName ); - StreamResult result = new StreamResult(file); - result.setSystemId(file.toURI().toURL().toString()); + String canonicalName = this.canonicalFileName(this.targetSchemaName); + File file = new File(canonicalName); + StreamResult result = new StreamResult(file); + result.setSystemId(file.toURL().toExternalForm()); return result; } + + public String canonicalFileName(String fileName) { + return canonicalFile(new File(fileName)).getAbsolutePath(); + } + + public File canonicalFile(File file) { + try { + return file.getCanonicalFile(); + } + catch (IOException ioexception) { + return file.getAbsoluteFile(); + } + } + } diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java index d27c374d21..e5c1d14de5 100644 --- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java +++ b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java @@ -332,11 +332,12 @@ public class SchemaGenerator // sourceClassNames StringBuffer sourceClassNamesArguments = this.buildClassNamesArguments(sourceClassNames); programArguments.append(sourceClassNamesArguments); - + // schema - programArguments.append(" -s "); //$NON-NLS-1$ + programArguments.append(" -s \""); //$NON-NLS-1$ programArguments.append(targetSchemaName); - + programArguments.append('"'); //$NON-NLS-1$ + this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString()); } |