From 34414c4042de949440113dae8254c91173088dcc Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 2 Dec 2009 12:27:30 +0100 Subject: jl145: #106849# assertion because osl_getAbsoluteFileUrl is called with file URL instead of a path as argument. --- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'jvmfwk') diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 1c846a410..317f80fb0 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -788,18 +788,15 @@ 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 & path) +OUString resolveDirPath(const OUString & dirUrl) { - OUString ret; - OUString sResolved; - if (File::getAbsoluteFileURL( - rtl::OUString(), path, sResolved) != File::E_None) - return OUString(); + OUString ret; //check if this is a valid path and if it is a directory DirectoryItem item; - if (DirectoryItem::get(sResolved, item) == File::E_None) + if (DirectoryItem::get(dirUrl, item) == File::E_None) { FileStatus status(FileStatusMask_Type | FileStatusMask_LinkTargetURL | @@ -808,7 +805,7 @@ OUString resolveDirPath(const OUString & path) if (item.getFileStatus(status) == File::E_None && status.getFileType() == FileStatus::Directory) { - ret = sResolved; + ret = dirUrl; } } else -- cgit v1.2.3 From a32dc82cb73aabdc6c7b04bfaa9f47fe0a668701 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 18 Jan 2010 12:24:16 +0100 Subject: #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 --- jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'jvmfwk') diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 9b6e7fc3d..dd7547b11 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 -- cgit v1.2.3