Use toURI().toURL() instead of the deprecated method toURL()

This commit is contained in:
Sam Harwell
2013-09-24 16:22:24 -05:00
parent 1ee57ff71e
commit e567bb9aaa
3 changed files with 5 additions and 5 deletions

View File

@@ -4508,7 +4508,7 @@ public abstract class EpubMojo
// new Float(.8));
// Create the transcoder input.
String svgURI = new File("/Users/nare4013/epub/rackspace-template/rackspace-template/target/docbkx/images/cloud/cover.svg").toURL().toString();
String svgURI = new File("/Users/nare4013/epub/rackspace-template/rackspace-template/target/docbkx/images/cloud/cover.svg").toURI().toURL().toString();
TranscoderInput input = new TranscoderInput(svgURI);
// Create the transcoder output.

View File

@@ -292,7 +292,7 @@ public abstract class PDFMojo extends AbstractFoMojo {
try
{
String baseURL = sourceDirectory.toURL().toExternalForm();
String baseURL = sourceDirectory.toURI().toURL().toExternalForm();
baseURL = baseURL.replace("file:/", "file:///");
userAgent.setBaseURL(baseURL);

View File

@@ -270,7 +270,7 @@ public class PDFBuilder {
File targetPdfFile = null;
try
{
String baseURL = sourceDirectory.toURL().toExternalForm();
String baseURL = sourceDirectory.toURI().toURL().toExternalForm();
baseURL = baseURL.replace("file:/", "file:///");
userAgent.setBaseURL(baseURL);
@@ -335,7 +335,7 @@ public class PDFBuilder {
public void adjustTransformer(Transformer transformer, String sourceFilename, File targetFile) {
String baseUrl;
try {
final String str = (new File(sourceFilename)).getParentFile().toURL().toExternalForm();
final String str = (new File(sourceFilename)).getParentFile().toURI().toURL().toExternalForm();
baseUrl = str.replace("file:/", "file:///");
} catch (MalformedURLException e) {
getLog().warn("Failed to get FO basedir", e);
@@ -1000,7 +1000,7 @@ public class PDFBuilder {
if (getStylesheetLocation().startsWith("http://")) {
return new URL(getStylesheetLocation());
}
return new File(getStylesheetLocation()).toURL();
return new File(getStylesheetLocation()).toURI().toURL();
} catch (MalformedURLException mue) {
return null;
}