ASF Bugzilla – Attachment 19607 Details for
Bug 40288
<base> url requires "/", failes otherwise
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
logs full url - not just relative part if there is a failed resolution
bug_40288.patch (text/plain), 2.11 KB, created by
Adrian Cumiskey
on 2007-02-16 06:44:36 UTC
(
hide
)
Description:
logs full url - not just relative part if there is a failed resolution
Filename:
MIME Type:
Creator:
Adrian Cumiskey
Created:
2007-02-16 06:44:36 UTC
Size:
2.11 KB
patch
obsolete
>Index: C:/workspace/fop/src/java/org/apache/fop/apps/FOURIResolver.java >=================================================================== >--- C:/workspace/fop/src/java/org/apache/fop/apps/FOURIResolver.java (revision 507572) >+++ C:/workspace/fop/src/java/org/apache/fop/apps/FOURIResolver.java (working copy) >@@ -87,7 +87,12 @@ > log.error("Could not convert filename to URL: " + mfue.getMessage()); > } > } else { >- URL baseURL = toBaseURL(base); >+ URL baseURL = null; >+ try { >+ baseURL = toBaseURL(base); >+ } catch( MalformedURLException mfue ) { >+ log.error("Error with base URL \"" + base + "\"): " + mfue.getMessage()); >+ } > if (baseURL == null) { > // We don't have a valid baseURL just use the URL as given > try { >@@ -155,7 +160,7 @@ > //Note: This is on "debug" level since the caller is supposed to handle this > log.debug("File not found: " + effURL); > } catch (java.io.IOException ioe) { >- log.error("Error with opening URL '" + href + "': " + ioe.getMessage()); >+ log.error("Error with opening URL '" + effURL + "': " + ioe.getMessage()); > } > return null; > } >@@ -201,15 +206,13 @@ > * @param baseURL the base URL > * @returns the base URL as java.net.URL > */ >- private URL toBaseURL(String baseURL) { >- try { >- return new URL(baseURL == null >- ? new java.io.File("").toURL().toExternalForm() >- : baseURL); >- } catch (MalformedURLException mfue) { >- log.error("Error with base URL \"" + baseURL + "\"): " + mfue.getMessage()); >+ private URL toBaseURL(String base) throws MalformedURLException { >+ if (base == null) { >+ base = new java.io.File("").toURL().toExternalForm(); >+ } else if (!base.endsWith("/")) { >+ base += "/"; > } >- return null; >+ return new URL(base); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 40288
:
19603
|
19604
| 19607