| author | ning.zhang | 2012-05-26 11:55:09 (EDT) |
|---|---|---|
| committer | dgao | 2012-05-26 11:55:09 (EDT) |
| commit | 89f62f8e87457e11f2d4d0dc423c73489fd3acfa (patch) (side-by-side diff) | |
| tree | 8ecc3c165d6ab982d4a27a23f0fb3532c027665d | |
| parent | cc3cb4ab3d469f1e74d785340ba1a7d01e58043c (diff) | |
| download | org.eclipse.birt-89f62f8e87457e11f2d4d0dc423c73489fd3acfa.zip org.eclipse.birt-89f62f8e87457e11f2d4d0dc423c73489fd3acfa.tar.gz org.eclipse.birt-89f62f8e87457e11f2d4d0dc423c73489fd3acfa.tar.bz2 | |
If the root path from the system properties is empty, a resource url is get from the app context's root path, and the url might be with a "file" protocal.
Fixed a bug when a path url starts with a file protocol but java.io.File.exists() cannot find the path successfully even if the path exists in the file system.
| -rw-r--r-- | viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java index f93d948..d7c65a7 100644 --- a/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java +++ b/viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/utility/ParameterAccessor.java @@ -2858,9 +2858,17 @@ public class ParameterAccessor URL url = context.getResource( "/" ); //$NON-NLS-1$ if ( url != null ) { - // for other url protocals, e.g. path in an unpacked - // war, or other global urls - String urlRoot = DataUtil.trimString( url.toExternalForm( ) ); + String urlRoot = null; + // for file urls + if("file".equalsIgnoreCase(url.getProtocol())) //$NON-NLS-1$ + { + urlRoot = DataUtil.trimString( url.getPath() ); + } + // for other url protocals, e.g. path in an unpacked war, or other global urls + else + { + urlRoot = DataUtil.trimString( url.toExternalForm( ) ); + } if ( orginalPath.startsWith( urlRoot ) ) { realPath = orginalPath; |

