summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-25 08:52:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-05-25 08:57:24 +0100
commit393247bbcd572b111c3430dee2081310c1b2185c (patch)
tree03e317bbf721a0b7d1463dcbe714ebc6375b683e /jvmfwk
parentff83c1d1a6eec0070b7a7351bb8d50db6edbc9d0 (diff)
add salhelper::LinkResolver
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/makefile.mk7
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx48
2 files changed, 17 insertions, 38 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk b/jvmfwk/plugins/sunmajor/pluginlib/makefile.mk
index 9640bf887..5b09a6795 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 83d919169..7026893da 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;
}