summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2002-10-15 15:19:30 +0000
committerAndreas Bille <abi@openoffice.org>2002-10-15 15:19:30 +0000
commitb16904eea160dd99ff77858abcfd280e3c4cb81a (patch)
treea4b71ba5b88b77f7ff497e34d087d2112ab4b349 /ucb
parentb7a478d46697a02f94357002c355ca9a8c6e1f8f (diff)
#100904# make all properties read only ( no cwd possible with libcurl )
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx40
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.hxx9
2 files changed, 43 insertions, 6 deletions
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 24188656d015..f42b4423955b 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftpcontent.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: abi $ $Date: 2002-10-15 13:59:09 $
+ * last change: $Author: abi $ $Date: 2002-10-15 16:19:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,7 +86,10 @@
#include <ucbhelper/propertyvalueset.hxx>
#include <ucbhelper/cancelcommandexecution.hxx>
#include <ucbhelper/simpleauthenticationrequest.hxx>
+#include <com/sun/star/lang/IllegalAccessException.hpp>
+#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
@@ -338,7 +341,6 @@ Any SAL_CALL FTPContent::execute(
aRet = p->getRequest();
}
-
// if(aCommand.Name.compareToAscii(
// "getPropertyValues") == 0 &&
// action != NOACTION) {
@@ -393,7 +395,16 @@ Any SAL_CALL FTPContent::execute(
aRet <<= getPropertyValues(Properties,Environment);
}
- else if(aCommand.Name.compareToAscii("setPropertyValues") == 0) {
+ else if(aCommand.Name.compareToAscii("setPropertyValues") == 0)
+ {
+ Sequence<PropertyValue> propertyValues;
+
+ if( ! ( aCommand.Argument >>= propertyValues ) ) {
+ aRet <<= IllegalArgumentException();
+ ucbhelper::cancelCommandExecution(aRet,Environment);
+ }
+
+ aRet <<= setPropertyValues(propertyValues);
}
else if(aCommand.Name.compareToAscii("getCommandInfo") == 0) {
// Note: Implemented by base class.
@@ -571,3 +582,24 @@ Reference< XRow > FTPContent::getPropertyValues(
return Reference<XRow>(xRow.getBodyPtr());
}
+
+
+
+Sequence<Any> FTPContent::setPropertyValues(
+ const Sequence<PropertyValue>& seqPropVal)
+{
+ Sequence<Property> props =
+ getProperties(Reference<XCommandEnvironment>(0));
+
+ Sequence<Any> ret(seqPropVal.getLength());
+ for(sal_Int32 i = 0; i < ret.getLength(); ++i) {
+ ret[i] <<= UnknownPropertyException();
+ for(sal_Int32 j = 0; j < props.getLength(); ++j)
+ if(props[j].Name == seqPropVal[i].Name) {
+ ret[i] <<= IllegalAccessException();
+ break;
+ }
+ }
+
+ return ret;
+}
diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx
index cc51377bdb74..257683a93dd3 100644
--- a/ucb/source/ucp/ftp/ftpcontent.hxx
+++ b/ucb/source/ucp/ftp/ftpcontent.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftpcontent.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: abi $ $Date: 2002-10-15 09:21:16 $
+ * last change: $Author: abi $ $Date: 2002-10-15 16:19:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -188,6 +188,11 @@ namespace ftp
com::sun::star::ucb::XCommandEnvironment >& Environment
);
+ ::com::sun::star::uno::Sequence<::com::sun::star::uno::Any>
+ setPropertyValues(
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue>& seqPropVal);
+
void insert(const com::sun::star::ucb::InsertCommandArgument&);
};