summaryrefslogtreecommitdiff
path: root/unotools/source/ucbhelper
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2001-09-10 15:34:48 +0000
committerMathias Bauer <mba@openoffice.org>2001-09-10 15:34:48 +0000
commit75c090a8ff8ec2c4921177f76d50f236577f03db (patch)
tree823148c31a38e7c86b6e84add02e75457ec96aab /unotools/source/ucbhelper
parent0958a2ea68773f591ae3d7cb5343c1d88b3c0998 (diff)
#92015#: new method GetProperty
Diffstat (limited to 'unotools/source/ucbhelper')
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx34
1 files changed, 32 insertions, 2 deletions
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index 20f903f19c1e..c916944d440d 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucbhelper.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mba $ $Date: 2001-07-18 17:22:26 $
+ * last change: $Author: mba $ $Date: 2001-09-10 16:34:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -224,6 +224,36 @@ sal_Bool UCBContentHelper::IsDocument( const String& rContent )
// -----------------------------------------------------------------------
+Any UCBContentHelper::GetProperty( const String& rContent, const ::rtl::OUString& rName )
+{
+ sal_Bool bRet = sal_False;
+ INetURLObject aObj( rContent );
+ DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" );
+ try
+ {
+ Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ return aCnt.getPropertyValue( rName );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_WARNING( "CommandAbortedException" );
+ }
+ catch( ::com::sun::star::ucb::IllegalIdentifierException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ContentCreationException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ::com::sun::star::uno::Exception& )
+ {
+ DBG_WARNING( "Any other exception" );
+ }
+
+ return Any();
+}
+
sal_Bool UCBContentHelper::IsFolder( const String& rContent )
{
sal_Bool bRet = sal_False;