diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-25 08:52:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-05-25 08:57:24 +0100 |
commit | ae59ac86469e5e001cc4e274f5c2fd5258621ae1 (patch) | |
tree | a74d98d5bccbc451713b5efd6ba0e3b30db86ab2 /jvmfwk/plugins/sunmajor/pluginlib | |
parent | c877cb39f176a9bb1a65c1844a495762ef635100 (diff) |
add salhelper::LinkResolver
Diffstat (limited to 'jvmfwk/plugins/sunmajor/pluginlib')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/makefile.mk | 7 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 46 |
2 files changed, 16 insertions, 37 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk b/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk index 9640bf887a2e..5b09a67952c5 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk +++ b/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk @@ -59,11 +59,10 @@ SHL1TARGET= $(UNOCOMPONENT1) SHL1STDLIBS= \ - $(CPPULIB) \ $(CPPUHELPER) \ - $(COMPHELPERLIB) \ - $(SALLIB) \ - $(SALHELPERLIB) + $(CPPULIB) \ + $(SALHELPERLIB) \ + $(SALLIB) .IF "$(GUI)" == "WNT" diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 6cbfb73ebfe0..00843ec8f03a 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -39,7 +39,7 @@ #include "rtl/byteseq.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/instance.hxx" -#include <comphelper/linkhelper.hxx> +#include <salhelper/linkhelper.hxx> #include "boost/scoped_array.hpp" #include "com/sun/star/uno/Sequence.hxx" #include <utility> @@ -822,31 +822,21 @@ bool getJREInfoByPath(const rtl::OUString& path, */ OUString resolveDirPath(const OUString & path) { - OUString sResolved = path; - - if (!comphelper::resolveLink(sResolved)) - return OUString(); - OUString ret; - - //check if this is a directory - DirectoryItem item; - if (DirectoryItem::get(sResolved, item) == File::E_None) + salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type | + osl_FileStatus_Mask_FileURL); + if (aResolver.fetchFileStatus(path) == osl::FileBase::E_None) { - FileStatus status(osl_FileStatus_Mask_Type | - osl_FileStatus_Mask_FileURL); - - if (item.getFileStatus(status) == File::E_None - && status.getFileType() == FileStatus::Directory) + //check if this is a directory + if (aResolver.m_aStatus.getFileType() == FileStatus::Directory) { #ifndef JVM_ONE_PATH_CHECK - ret = sResolved; + ret = aResolver.m_aStatus.getFileURL(); #else ret = path; #endif } } - return ret; } /** Checks if the path is a file. If it is a link to a file than @@ -854,31 +844,21 @@ OUString resolveDirPath(const OUString & path) */ OUString resolveFilePath(const OUString & path) { - OUString sResolved = path; - - if (!comphelper::resolveLink(sResolved)) - return OUString(); - OUString ret; - - //check if this is a valid path to a file or and if it is a link - DirectoryItem item; - if (DirectoryItem::get(sResolved, item) == File::E_None) + salhelper::LinkResolver aResolver(osl_FileStatus_Mask_Type | + osl_FileStatus_Mask_FileURL); + if (aResolver.fetchFileStatus(path) == osl::FileBase::E_None) { - FileStatus status(osl_FileStatus_Mask_Type | - osl_FileStatus_Mask_FileURL); - - if (item.getFileStatus(status) == File::E_None - && status.getFileType() == FileStatus::Regular) + //check if this is a file + if (aResolver.m_aStatus.getFileType() == FileStatus::Regular) { #ifndef JVM_ONE_PATH_CHECK - ret = sResolved; + ret = aResolver.m_aStatus.getFileURL(); #else ret = path; #endif } } - return ret; } |