From c6826a3905f0d51bc4719d998d6031981bfd09a1 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 a823d551af88..3a1dc0e05c28 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 From 3644d82a157deb545a1704012d9c5d40807ae4f2 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 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 -- cgit