summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-01-18 12:24:16 +0100
committerJoachim Lingner <jl@openoffice.org>2010-01-18 12:24:16 +0100
commit3644d82a157deb545a1704012d9c5d40807ae4f2 (patch)
treead99ea09860535a7e48cf2f74ac9963d0f5e6be8 /jvmfwk
parent4889d02f40f73629a0d33ba4e3fe4fb5997458f8 (diff)
#jl145: #i106849# resolving link to a directory not working by applying the first fix. Redone and added a relative base URL file:/// in the call to osl_getAbsolutFileURL
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 0df33f6160a4..0e0f58e4268a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -791,15 +791,19 @@ bool getJREInfoByPath(const rtl::OUString& path,
/** Checks if the path is a directory. Links are resolved.
In case of an error the returned string has the length 0.
Otherwise the returned string is the "resolved" file URL.
-
*/
-OUString resolveDirPath(const OUString & dirUrl)
+OUString resolveDirPath(const OUString & path)
{
- OUString ret;
+ OUString ret;
+ OUString sResolved;
+ //getAbsoluteFileURL also resolves links
+ if (File::getAbsoluteFileURL(
+ OUSTR("file:///"), path, sResolved) != File::E_None)
+ return OUString();
//check if this is a valid path and if it is a directory
DirectoryItem item;
- if (DirectoryItem::get(dirUrl, item) == File::E_None)
+ if (DirectoryItem::get(sResolved, item) == File::E_None)
{
FileStatus status(FileStatusMask_Type |
FileStatusMask_LinkTargetURL |
@@ -808,7 +812,7 @@ OUString resolveDirPath(const OUString & dirUrl)
if (item.getFileStatus(status) == File::E_None
&& status.getFileType() == FileStatus::Directory)
{
- ret = dirUrl;
+ ret = sResolved;
}
}
else
@@ -824,7 +828,7 @@ OUString resolveFilePath(const OUString & path)
OUString sResolved;
if (File::getAbsoluteFileURL(
- rtl::OUString(), path, sResolved) != File::E_None)
+ OUSTR("file:///"), path, sResolved) != File::E_None)
return OUString();
//check if this is a valid path to a file or and if it is a link