Directory separator replacement uses path.replace(File.separatorChar, '/') (fixes #26)
This commit is contained in:
@@ -454,7 +454,7 @@ public abstract class PDFMojo extends AbstractFoMojo {
|
||||
File imageDirectory = getImageDirectory();
|
||||
File calloutDirectory = new File (imageDirectory, "callouts");
|
||||
|
||||
transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath().replaceAll("\\\\","/"));
|
||||
transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath().replace(File.separatorChar, '/'));
|
||||
transformer.setParameter("source.directory",sourceDirectory);
|
||||
transformer.setParameter("compute.wadl.path.from.docbook.path",computeWadlPathFromDocbookPath);
|
||||
|
||||
@@ -506,7 +506,7 @@ public abstract class PDFMojo extends AbstractFoMojo {
|
||||
//transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath());
|
||||
String srcFilename = sourceDocBook.getName();
|
||||
getLog().info("SOURCE FOR COVER PAGE: "+this.projectBuildDirectory+"/docbkx/"+srcFilename);
|
||||
transformer.setParameter("docbook.infile", this.projectBuildDirectory.replaceAll("\\\\","/")+"/docbkx/"+srcFilename);
|
||||
transformer.setParameter("docbook.infile", this.projectBuildDirectory.replace(File.separatorChar, '/')+"/docbkx/"+srcFilename);
|
||||
transformer.transform (new StreamSource(coverImageTemplate), new StreamResult(coverImage));
|
||||
}
|
||||
catch (TransformerConfigurationException e)
|
||||
@@ -527,7 +527,7 @@ public abstract class PDFMojo extends AbstractFoMojo {
|
||||
|
||||
String pathToPipelineFile = "classpath:/pdf.xpl"; //use "classpath:/path" for this to work
|
||||
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replaceAll("\\\\","/");
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replace(File.separatorChar, '/');
|
||||
//from super
|
||||
final InputSource inputSource = new InputSource(sourceFileNameNormalized);
|
||||
Source source = new SAXSource(filter, inputSource);
|
||||
@@ -543,7 +543,7 @@ public abstract class PDFMojo extends AbstractFoMojo {
|
||||
String targetDirString = "";
|
||||
|
||||
try{
|
||||
targetDirString = this.getTargetDirectory().getParentFile().getCanonicalPath().replaceAll("\\\\","/");
|
||||
targetDirString = this.getTargetDirectory().getParentFile().getCanonicalPath().replace(File.separatorChar, '/');
|
||||
}catch(Exception e){
|
||||
getLog().info("Exceptional!" + e);
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
|
||||
|
||||
String pathToPipelineFile = "classpath:/webhelp.xpl"; //use "classpath:/path" for this to work
|
||||
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replaceAll("\\\\","/");
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replace(File.separatorChar, '/');
|
||||
//from super
|
||||
final InputSource inputSource = new InputSource(sourceFileNameNormalized);
|
||||
Source source = new SAXSource(filter, inputSource);
|
||||
@@ -765,7 +765,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
|
||||
String targetDirString = "";
|
||||
|
||||
try{
|
||||
targetDirString = this.getTargetDirectory().getParentFile().getCanonicalPath().replaceAll("\\\\","/");
|
||||
targetDirString = this.getTargetDirectory().getParentFile().getCanonicalPath().replace(File.separatorChar, '/');
|
||||
}catch(Exception e){
|
||||
getLog().info("Exceptional!" + e);
|
||||
}
|
||||
@@ -853,7 +853,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
|
||||
|
||||
map.put("targetDir", baseDir.getAbsolutePath()+File.separator+"figures");
|
||||
// String targetDirFiguresString = baseDir.getAbsolutePath()+File.separator+"figures";
|
||||
// map.put("targetDir", targetDirFiguresString.replaceAll("\\\\","/").replace("file:/", "file:///"));
|
||||
// map.put("targetDir", targetDirFiguresString.replace(File.separatorChar, '/').replace("file:/", "file:///"));
|
||||
|
||||
// getLog().info("~~~~~~~~FOOBAR~~~~~~~~~~~~~~~~:");
|
||||
// getLog().info("~~~~~~~~baseDir:" + baseDir);
|
||||
|
||||
@@ -480,8 +480,8 @@ public class PDFBuilder {
|
||||
// transformer.setParameter("docbook.infile", sourceFilePath);
|
||||
|
||||
|
||||
getLog().info("SOURCE FOR COVER PAGE: "+this.projectBuildDirectory.replaceAll("\\\\","/")+"/"+inputFilename);
|
||||
transformer.setParameter("docbook.infile", this.projectBuildDirectory.replaceAll("\\\\","/")+"/"+inputFilename);
|
||||
getLog().info("SOURCE FOR COVER PAGE: "+this.projectBuildDirectory.replace(File.separatorChar, '/')+"/"+inputFilename);
|
||||
transformer.setParameter("docbook.infile", this.projectBuildDirectory.replace(File.separatorChar, '/')+"/"+inputFilename);
|
||||
|
||||
transformer.transform (new StreamSource(coverImageTemplate), new StreamResult(coverImage));
|
||||
}
|
||||
@@ -1067,7 +1067,7 @@ public class PDFBuilder {
|
||||
throws MojoExecutionException {
|
||||
String pathToPipelineFile = "classpath:/pdf.xpl"; //use "classpath:/path" for this to work
|
||||
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replaceAll("\\\\","/");
|
||||
String sourceFileNameNormalized = "file:///" + sourceFile.getAbsolutePath().replace(File.separatorChar, '/');
|
||||
//from super
|
||||
final InputSource inputSource = new InputSource(sourceFileNameNormalized);
|
||||
Source source = new SAXSource(filter, inputSource);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.rackspace.cloud.api.docs.calabash.extensions;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
|
||||
import net.sf.saxon.s9api.QName;
|
||||
@@ -72,12 +73,7 @@ public class CopyAndTransformXProcStep extends DefaultStep {
|
||||
URI uri = null;
|
||||
|
||||
if (target != null) {
|
||||
|
||||
String targetFixed = FilenameUtils.normalizeNoEndSeparator(target.getString()).replaceAll("\\\\","/").replace("file:/", "file:///");
|
||||
|
||||
uri = target.getBaseURI().resolve(targetFixed);
|
||||
|
||||
uri = target.getBaseURI().resolve(FilenameUtils.normalizeNoEndSeparator(target.getString()));
|
||||
uri = target.getBaseURI().resolve(FilenameUtils.normalizeNoEndSeparator(target.getString()).replace(File.separatorChar, '/'));
|
||||
}
|
||||
|
||||
return uri;
|
||||
@@ -87,7 +83,7 @@ public class CopyAndTransformXProcStep extends DefaultStep {
|
||||
RuntimeValue target = getOption(_targetHtmlContentDir);
|
||||
URI uri = null;
|
||||
if (target != null) {
|
||||
uri = target.getBaseURI().resolve(target.getString().replaceAll("\\\\","/"));
|
||||
uri = target.getBaseURI().resolve(target.getString().replace(File.separatorChar, '/'));
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user