summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2002-10-15 12:04:04 +0000
committerAndreas Bille <abi@openoffice.org>2002-10-15 12:04:04 +0000
commit213448a74eeb03bd61a9caa6ec0ee2a215638063 (patch)
tree774ea10192cd4f2ec4aa242b0c68b3fe6426cc62 /ucb
parentc75a754e5916abcf020e38af6021c6e773c952e7 (diff)
#100904# Added support for several calls to interactionhandler
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx25
-rw-r--r--ucb/source/ucp/ftp/ftpcontentprovider.cxx11
-rw-r--r--ucb/source/ucp/ftp/ftpurl.cxx34
-rw-r--r--ucb/source/ucp/ftp/ftpurl.hxx6
4 files changed, 64 insertions, 12 deletions
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 58dd8a1c4e49..bef19a42a568 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.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: abi $ $Date: 2002-10-15 09:21:15 $
+ * last change: $Author: abi $ $Date: 2002-10-15 13:04:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -95,6 +95,7 @@
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
#include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp>
+#include <com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/ucb/IOErrorCode.hpp>
@@ -267,7 +268,8 @@ public:
enum ACTION { NOACTION,
THROWAUTHENTICATIONREQUEST,
THROWACCESSDENIED,
- THROWINTERACTIVECONNECT };
+ THROWINTERACTIVECONNECT,
+ THROWRESOLVENAME };
// virtual
@@ -291,6 +293,11 @@ Any SAL_CALL FTPContent::execute(
if(action == THROWAUTHENTICATIONREQUEST) {
// try to get a continuation first
rtl::OUString aRealm,aPassword,aAccount;
+ m_pFCP->forHost(m_aFTPURL.host(),
+ m_aFTPURL.port(),
+ m_aFTPURL.username(),
+ aPassword,
+ aAccount);
rtl::Reference<ucbhelper::SimpleAuthenticationRequest>
p( new ucbhelper::SimpleAuthenticationRequest(
m_aFTPURL.host(), // ServerName
@@ -366,6 +373,14 @@ Any SAL_CALL FTPContent::execute(
ucbhelper::cancelCommandExecution(
aRet,
Environment);
+ } else if(action == THROWRESOLVENAME) {
+ InteractiveNetworkResolveNameException
+ excep;
+ excep.Server = m_aFTPURL.host();
+ aRet <<= excep;
+ ucbhelper::cancelCommandExecution(
+ aRet,
+ Environment);
}
if(aCommand.Name.compareToAscii("getPropertyValues") == 0) {
@@ -462,6 +477,8 @@ Any SAL_CALL FTPContent::execute(
} catch(const curl_exception& e) {
if(e.code() == CURLE_COULDNT_CONNECT)
action = THROWINTERACTIVECONNECT;
+ else if(e.code() == CURLE_COULDNT_RESOLVE_HOST )
+ action = THROWRESOLVENAME;
else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT ||
e.code() == CURLE_BAD_PASSWORD_ENTERED ||
e.code() == CURLE_FTP_WEIRD_PASS_REPLY )
@@ -507,7 +524,7 @@ rtl::OUString FTPContent::getParentURL()
void FTPContent::insert(const InsertCommandArgument& aInsertCommand)
{
// m_aFTPURL.insert(bool(aInsertCommand.ReplaceExisting),
-
+// aInsertCommand.Data);
}
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index 6a93faf178e3..a63f44b3c622 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftpcontentprovider.cxx,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 13:04:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -179,7 +179,12 @@ FTPContentProvider::queryContent(
}
}
- xContent = new FTPContent(m_xSMgr,this,xCanonicId);
+ try {
+ xContent = new FTPContent(m_xSMgr,this,xCanonicId);
+ } catch(const malformed_exception&) {
+ throw IllegalIdentifierException();
+ }
+
// may throw IllegalIdentifierException
return xContent;
}
diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx
index 32ab5943ec7d..84b687dc1008 100644
--- a/ucb/source/ucp/ftp/ftpurl.cxx
+++ b/ucb/source/ucp/ftp/ftpurl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftpurl.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: abi $ $Date: 2002-10-15 09:21:17 $
+ * last change: $Author: abi $ $Date: 2002-10-15 13:04:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -189,7 +189,9 @@ void FTPURL::parse(const rtl::OUString& url)
const char* p2 = aIdent.getStr();
- if(strncmp("ftp://",p2,6))
+ rtl::OString lower = aIdent.toAsciiLowerCase();
+ if(lower.getLength() >= 6 &&
+ strncmp("ftp://",lower.getStr(),6))
throw malformed_exception();
p2 += 6;
@@ -644,3 +646,29 @@ FTPDirentry FTPURL::direntry() const
}
return aDirentry;
}
+
+
+extern "C" {
+
+ size_t memory_read(void *ptr,size_t size,size_t nmemb, void *stream)
+ {
+ return 0;
+ }
+
+}
+
+
+void FTPURL::insert(bool replaceExisting) const
+ throw(curl_exception)
+{
+ CURL *curl = m_pFCP->handle();
+
+ SET_CONTROL_CONTAINER;
+ curl_easy_setopt(curl,CURLOPT_NOBODY,TRUE); // no data => no transfer
+
+ rtl::OUString url(ident(false,true));
+ SET_URL(url);
+ curl_easy_setopt(curl,CURLOPT_POSTQUOTE,0);
+
+ CURLcode err;
+}
diff --git a/ucb/source/ucp/ftp/ftpurl.hxx b/ucb/source/ucp/ftp/ftpurl.hxx
index 432848f76b81..0225ae4f966a 100644
--- a/ucb/source/ucp/ftp/ftpurl.hxx
+++ b/ucb/source/ucp/ftp/ftpurl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftpurl.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: abi $ $Date: 2002-10-15 09:21:17 $
+ * last change: $Author: abi $ $Date: 2002-10-15 13:04:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -155,6 +155,8 @@ namespace ftp {
FTPDirentry direntry() const throw(curl_exception);
+ void insert(bool ReplaceExisting) const throw(curl_exception);
+
private: