summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/ftp
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/ftp')
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx229
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.hxx24
-rw-r--r--ucb/source/ucp/ftp/ftpcontentcaps.cxx28
-rw-r--r--ucb/source/ucp/ftp/ftpdirp.cxx12
-rw-r--r--ucb/source/ucp/ftp/ftpdirp.hxx5
-rw-r--r--ucb/source/ucp/ftp/ftpinpstr.cxx11
-rw-r--r--ucb/source/ucp/ftp/ftpintreq.cxx14
-rw-r--r--ucb/source/ucp/ftp/ftpintreq.hxx4
-rw-r--r--ucb/source/ucp/ftp/ftpresultsetI.cxx6
-rw-r--r--ucb/source/ucp/ftp/ftpurl.cxx23
10 files changed, 198 insertions, 158 deletions
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index e4533d872275..73300c16844b 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -106,19 +106,6 @@ using namespace com::sun::star::sdbc;
FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr,
FTPContentProvider* pProvider,
- const Reference< XContentIdentifier >& Identifier)
- : ContentImplHelper(rxSMgr,pProvider,Identifier),
- m_pFCP(pProvider),
- m_aFTPURL(Identifier->getContentIdentifier(),
- pProvider),
- m_bInserted(false),
- m_bTitleSet(false)
-{
-}
-
-
-FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr,
- FTPContentProvider* pProvider,
const Reference< XContentIdentifier >& Identifier,
const FTPURL& aFTPURL)
: ContentImplHelper(rxSMgr,pProvider,Identifier),
@@ -175,9 +162,9 @@ XINTERFACE_IMPL_6( FTPContent,
//=========================================================================
XTYPEPROVIDER_IMPL_6( FTPContent,
- XTypeProvider,
- XServiceInfo,
- XContent,
+ XTypeProvider,
+ XServiceInfo,
+ XContent,
XCommandProcessor,
XContentCreator,
XChild);
@@ -231,7 +218,7 @@ void SAL_CALL FTPContent::abort( sal_Int32 /*CommandId*/ )
/***************************************************************************/
/* */
-/* Interne Implklasse */
+/* Internal implementation class. */
/* */
/***************************************************************************/
@@ -376,66 +363,85 @@ Any SAL_CALL FTPContent::execute(
// return aRet;
// }
- if(action == THROWAUTHENTICATIONREQUEST) {
+ switch (action)
+ {
+ case NOACTION:
+ break;
+
+ case THROWAUTHENTICATIONREQUEST:
ucbhelper::cancelCommandExecution(
aRet,
Reference<XCommandEnvironment>(0));
- } else if(action == THROWACCESSDENIED) {
- Sequence<Any> seq(1);
- PropertyValue value;
- value.Name =
- rtl::OUString::createFromAscii("Uri");
- value.Handle = -1;
- value.Value <<= m_aFTPURL.ident(false,false);
- value.State = PropertyState_DIRECT_VALUE;
- seq[0] <<= value;
- ucbhelper::cancelCommandExecution(
- IOErrorCode_ACCESS_DENIED,
- seq,
- Environment);
- } else if(action == THROWINTERACTIVECONNECT) {
- InteractiveNetworkConnectException
- excep;
- excep.Server = m_aFTPURL.host();
- aRet <<= excep;
- ucbhelper::cancelCommandExecution(
- aRet,
- Environment);
- } else if(action == THROWRESOLVENAME) {
- InteractiveNetworkResolveNameException
- excep;
- excep.Server = m_aFTPURL.host();
- aRet <<= excep;
- ucbhelper::cancelCommandExecution(
- aRet,
- Environment);
- } else if(action == THROWNOFILE) {
- Sequence<Any> seq(1);
- PropertyValue value;
- value.Name =
- rtl::OUString::createFromAscii("Uri");
- value.Handle = -1;
- value.Value <<= m_aFTPURL.ident(false,false);
- value.State = PropertyState_DIRECT_VALUE;
- seq[0] <<= value;
- ucbhelper::cancelCommandExecution(
- IOErrorCode_NO_FILE,
- seq,
- Environment);
- } else if(action == THROWQUOTE ||
- action == THROWGENERAL) {
+ break;
+
+ case THROWACCESSDENIED:
+ {
+ Sequence<Any> seq(1);
+ PropertyValue value;
+ value.Name = rtl::OUString::createFromAscii("Uri");
+ value.Handle = -1;
+ value.Value <<= m_aFTPURL.ident(false,false);
+ value.State = PropertyState_DIRECT_VALUE;
+ seq[0] <<= value;
+ ucbhelper::cancelCommandExecution(
+ IOErrorCode_ACCESS_DENIED,
+ seq,
+ Environment);
+ break;
+ }
+ case THROWINTERACTIVECONNECT:
+ {
+ InteractiveNetworkConnectException excep;
+ excep.Server = m_aFTPURL.host();
+ aRet <<= excep;
+ ucbhelper::cancelCommandExecution(
+ aRet,
+ Environment);
+ break;
+ }
+ case THROWRESOLVENAME:
+ {
+ InteractiveNetworkResolveNameException excep;
+ excep.Server = m_aFTPURL.host();
+ aRet <<= excep;
+ ucbhelper::cancelCommandExecution(
+ aRet,
+ Environment);
+ break;
+ }
+ case THROWNOFILE:
+ {
+ Sequence<Any> seq(1);
+ PropertyValue value;
+ value.Name = rtl::OUString::createFromAscii("Uri");
+ value.Handle = -1;
+ value.Value <<= m_aFTPURL.ident(false,false);
+ value.State = PropertyState_DIRECT_VALUE;
+ seq[0] <<= value;
+ ucbhelper::cancelCommandExecution(
+ IOErrorCode_NO_FILE,
+ seq,
+ Environment);
+ break;
+ }
+ case THROWQUOTE:
+ case THROWGENERAL:
ucbhelper::cancelCommandExecution(
IOErrorCode_GENERAL,
Sequence<Any>(0),
Environment);
+ break;
}
-
if(aCommand.Name.compareToAscii("getPropertyValues") == 0) {
Sequence<Property> Properties;
if(!(aCommand.Argument >>= Properties))
{
- aRet <<= IllegalArgumentException();
+ aRet <<= IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1);
ucbhelper::cancelCommandExecution(aRet,Environment);
}
@@ -446,7 +452,11 @@ Any SAL_CALL FTPContent::execute(
Sequence<PropertyValue> propertyValues;
if( ! ( aCommand.Argument >>= propertyValues ) ) {
- aRet <<= IllegalArgumentException();
+ aRet <<= IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1);
ucbhelper::cancelCommandExecution(aRet,Environment);
}
@@ -464,7 +474,11 @@ Any SAL_CALL FTPContent::execute(
{
InsertCommandArgument aInsertArgument;
if ( ! ( aCommand.Argument >>= aInsertArgument ) ) {
- aRet <<= IllegalArgumentException();
+ aRet <<= IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1);
ucbhelper::cancelCommandExecution(aRet,Environment);
}
insert(aInsertArgument,Environment);
@@ -476,7 +490,12 @@ Any SAL_CALL FTPContent::execute(
else if(aCommand.Name.compareToAscii( "open" ) == 0) {
OpenCommandArgument2 aOpenCommand;
if ( !( aCommand.Argument >>= aOpenCommand ) ) {
- aRet <<= IllegalArgumentException();
+ aRet <<= IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1);
+
ucbhelper::cancelCommandExecution(aRet,Environment);
}
@@ -529,7 +548,10 @@ Any SAL_CALL FTPContent::execute(
}
}
else {
- aRet <<= UnsupportedDataSinkException();
+ aRet <<= UnsupportedDataSinkException(
+ rtl::OUString(),
+ static_cast< cppu::OWeakObject * >(this),
+ aOpenCommand.Sink);
ucbhelper::cancelCommandExecution(aRet,Environment);
}
}
@@ -557,17 +579,39 @@ Any SAL_CALL FTPContent::execute(
aOpenCommand.Mode ==
OpenMode::DOCUMENT_SHARE_DENY_WRITE) {
// Unsupported OpenMode
- aRet <<= UnsupportedOpenModeException();
+ aRet <<= UnsupportedOpenModeException(
+ rtl::OUString(),
+ static_cast< cppu::OWeakObject * >(this),
+ static_cast< sal_Int16 >(aOpenCommand.Mode));
ucbhelper::cancelCommandExecution(aRet,Environment);
}
else {
- // IllegalArgumentException:: No OpenMode
- aRet <<= IllegalArgumentException();
+ aRet <<= IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Unexpected OpenMode!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1);
+
ucbhelper::cancelCommandExecution(aRet,Environment);
}
- }
- else {
- aRet <<= UnsupportedCommandException();
+ } else if(aCommand.Name.compareToAscii("createNewContent") == 0) {
+ ContentInfo aArg;
+ if (!(aCommand.Argument >>= aArg)) {
+ ucbhelper::cancelCommandExecution(
+ makeAny(
+ IllegalArgumentException(
+ rtl::OUString::createFromAscii(
+ "Wrong argument type!" ),
+ static_cast< cppu::OWeakObject * >(this),
+ -1)),
+ Environment);
+ // Unreachable
+ }
+ aRet <<= createNewContent(aArg);
+ } else {
+ aRet <<= UnsupportedCommandException(
+ aCommand.Name,
+ static_cast< cppu::OWeakObject * >(this));
ucbhelper::cancelCommandExecution(aRet,Environment);
}
@@ -578,8 +622,11 @@ Any SAL_CALL FTPContent::execute(
else if(e.code() == CURLE_COULDNT_RESOLVE_HOST )
action = THROWRESOLVENAME;
else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT ||
+#if LIBCURL_VERSION_NUM>=0x070d01 /* 7.13.1 */
+ e.code() == CURLE_LOGIN_DENIED ||
+#endif
e.code() == CURLE_BAD_PASSWORD_ENTERED ||
- e.code() == CURLE_FTP_WEIRD_PASS_REPLY )
+ e.code() == CURLE_FTP_WEIRD_PASS_REPLY)
action = THROWAUTHENTICATIONREQUEST;
else if(e.code() == CURLE_FTP_ACCESS_DENIED)
action = THROWACCESSDENIED;
@@ -588,7 +635,7 @@ Any SAL_CALL FTPContent::execute(
else if(e.code() == CURLE_FTP_COULDNT_RETR_FILE)
action = THROWNOFILE;
else
- // nothing known about the course of the error
+ // nothing known about the cause of the error
action = THROWGENERAL;
}
}
@@ -605,6 +652,14 @@ Sequence<ContentInfo > SAL_CALL
FTPContent::queryCreatableContentsInfo( )
throw (RuntimeException)
{
+ return queryCreatableContentsInfo_Static();
+}
+
+// static
+Sequence<ContentInfo >
+FTPContent::queryCreatableContentsInfo_Static( )
+ throw (RuntimeException)
+{
Sequence< ContentInfo > seq(2);
seq[0].Type = FTP_FILE;
@@ -627,7 +682,6 @@ FTPContent::queryCreatableContentsInfo( )
return seq;
}
-
Reference<XContent > SAL_CALL
FTPContent::createNewContent( const ContentInfo& Info )
throw (RuntimeException)
@@ -697,7 +751,7 @@ sal_Int32 InsertData::read(sal_Int8 *dest,sal_Int32 nBytesRequested)
sal_Int32 m = 0;
if(m_xInputStream.is()) {
- Sequence<sal_Int8> seq(nBytesRequested);
+ Sequence<sal_Int8> seq(nBytesRequested);
m = m_xInputStream->readBytes(seq,nBytesRequested);
rtl_copyMemory(dest,seq.getConstArray(),m);
}
@@ -798,6 +852,9 @@ Reference< XRow > FTPContent::getPropertyValues(
const rtl::OUString& Name = seqProp[i].Name;
if(Name.compareToAscii("Title") == 0)
xRow->appendString(seqProp[i],aDirEntry.m_aName);
+ else if(Name.compareToAscii("CreatableContentsInfo") == 0)
+ xRow->appendObject(seqProp[i],
+ makeAny(queryCreatableContentsInfo()));
else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) {
if(Name.compareToAscii("ContentType") == 0)
xRow->appendString(seqProp[i],
@@ -838,9 +895,6 @@ Reference< XRow > FTPContent::getPropertyValues(
Sequence<Any> FTPContent::setPropertyValues(
const Sequence<PropertyValue>& seqPropVal)
{
- Sequence<Property> props =
- getProperties(Reference<XCommandEnvironment>(0));
-
Sequence<Any> ret(seqPropVal.getLength());
Sequence<PropertyChangeEvent > evt;
@@ -879,11 +933,20 @@ Sequence<Any> FTPContent::setPropertyValues(
ret[i] <<= excep;
}
} else {
- // either not unknown or illegal
+ Sequence<Property> props =
+ getProperties(Reference<XCommandEnvironment>(0));
+
+ // either unknown or read-only
ret[i] <<= UnknownPropertyException();
for(sal_Int32 j = 0; j < props.getLength(); ++j)
if(props[j].Name == seqPropVal[i].Name) {
- ret[i] <<= IllegalAccessException();
+ ret[i] <<= IllegalAccessException(
+ rtl::OUString::createFromAscii(
+ "Property is read-only!"),
+ //props[j].Attributes & PropertyAttribute::READONLY
+ // ? "Property is read-only!"
+ // : "Access denied!"),
+ static_cast< cppu::OWeakObject * >( this ));
break;
}
}
diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx
index 3d243cff84dd..0b41c9be1d03 100644
--- a/ucb/source/ucp/ftp/ftpcontent.hxx
+++ b/ucb/source/ucp/ftp/ftpcontent.hxx
@@ -57,19 +57,6 @@ namespace ftp
//=========================================================================
- struct ContentProperties
- {
- ::rtl::OUString aTitle; // Title
- ::rtl::OUString aContentType; // ContentType
- sal_Bool bIsDocument; // IsDocument
- sal_Bool bIsFolder; // IsFolder
-
- ContentProperties()
- : bIsDocument( sal_True ), bIsFolder( sal_False ) {}
- };
-
-//=========================================================================
-
class FTPContentProvider;
//=========================================================================
@@ -84,12 +71,6 @@ namespace ftp
::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
FTPContentProvider* pProvider,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContentIdentifier >& Identifier);
-
- FTPContent( const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
- FTPContentProvider* pProvider,
- const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XContentIdentifier >& Identifier,
const FTPURL& FtpUrl);
@@ -156,6 +137,11 @@ namespace ftp
::com::sun::star::uno::RuntimeException);
+ static com::sun::star::uno::Sequence<
+ com::sun::star::ucb::ContentInfo >
+ queryCreatableContentsInfo_Static( )
+ throw (com::sun::star::uno::RuntimeException);
+
private:
FTPContentProvider *m_pFCP;
diff --git a/ucb/source/ucp/ftp/ftpcontentcaps.cxx b/ucb/source/ucp/ftp/ftpcontentcaps.cxx
index 59fa976ff656..874bb9bbd0d0 100644
--- a/ucb/source/ucp/ftp/ftpcontentcaps.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentcaps.cxx
@@ -49,7 +49,7 @@ using namespace ftp;
uno::Sequence< beans::Property > FTPContent::getProperties(
const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/)
{
- #define PROPS_COUNT 7
+ #define PROPS_COUNT 8
static const beans::Property aPropsInfoTable[] =
{
@@ -91,7 +91,7 @@ uno::Sequence< beans::Property > FTPContent::getProperties(
beans::Property(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
-1,
- getCppuType( static_cast< util::DateTime* >( 0 ) ),
+ getCppuType( static_cast< util::DateTime * >( 0 ) ),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
),
@@ -101,10 +101,19 @@ uno::Sequence< beans::Property > FTPContent::getProperties(
getCppuBooleanType(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
+ ),
+ beans::Property(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "CreatableContentsInfo" ) ),
+ -1,
+ getCppuType(
+ static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::READONLY
)
};
- return uno::Sequence< beans::Property >( aPropsInfoTable,PROPS_COUNT);
+ return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT );
}
//=========================================================================
@@ -112,7 +121,7 @@ uno::Sequence< beans::Property > FTPContent::getProperties(
uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
{
-// osl::MutexGuard aGuard( m_aMutex );
+// osl::MutexGuard aGuard( m_aMutex );
//=================================================================
//
@@ -120,7 +129,7 @@ uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
//
//=================================================================
- #define COMMAND_COUNT 7
+ #define COMMAND_COUNT 8
static const ucb::CommandInfo aCommandInfoTable[] =
{
@@ -167,10 +176,15 @@ uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
-1,
- getCppuType( static_cast< sal_Bool * >( 0 ) )
+ getCppuBooleanType()
+ ),
+ ucb::CommandInfo(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
+ -1,
+ getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
)
};
- return uno::Sequence<ucb::CommandInfo>(aCommandInfoTable,COMMAND_COUNT);
+ return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
}
diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx
index 2b281e73319d..516ad7e84ddb 100644
--- a/ucb/source/ucp/ftp/ftpdirp.cxx
+++ b/ucb/source/ucp/ftp/ftpdirp.cxx
@@ -974,18 +974,6 @@ sal_Bool FTPDirectoryParser::parseUNIX (
}
/*
- * parseUNKNOWN.
- */
-sal_Bool FTPDirectoryParser::parseUNKNOWN (
- FTPDirentry &rEntry,
- const sal_Char *pBuffer,
- sal_uInt32 nLength)
-{
- setPath (rEntry.m_aName, pBuffer,sal_Int32 (nLength));
- return sal_True;
-}
-
-/*
* parseUNIX_isSizeField.
*/
sal_Bool FTPDirectoryParser::parseUNIX_isSizeField (
diff --git a/ucb/source/ucp/ftp/ftpdirp.hxx b/ucb/source/ucp/ftp/ftpdirp.hxx
index 4a57ee841cba..94df845d3806 100644
--- a/ucb/source/ucp/ftp/ftpdirp.hxx
+++ b/ucb/source/ucp/ftp/ftpdirp.hxx
@@ -146,11 +146,6 @@ namespace ftp {
FTPDirentry &rEntry,
const sal_Char *pBuffer );
- static sal_Bool parseUNKNOWN (
- FTPDirentry &rEntry,
- const sal_Char *pBuffer,
- sal_uInt32 nLength);
-
private:
diff --git a/ucb/source/ucp/ftp/ftpinpstr.cxx b/ucb/source/ucp/ftp/ftpinpstr.cxx
index 91b283271eb3..2f7a82baa234 100644
--- a/ucb/source/ucp/ftp/ftpinpstr.cxx
+++ b/ucb/source/ucp/ftp/ftpinpstr.cxx
@@ -56,8 +56,8 @@ FTPInputStream::FTPInputStream(FILE* tmpfl)
: m_tmpfl(tmpfl ? tmpfl : tmpfile())
{
fseek(m_tmpfl,0,SEEK_END);
-// fpos_t pos;
-// fgetpos(m_tmpfl,&pos);
+// fpos_t pos;
+// fgetpos(m_tmpfl,&pos);
long pos = ftell(m_tmpfl);
rewind(m_tmpfl);
m_nLength = sal_Int64(pos);
@@ -119,14 +119,17 @@ sal_Int32 SAL_CALL FTPInputStream::readBytes(Sequence< sal_Int8 >& aData,
long bpos,epos;
bpos = ftell(m_tmpfl);
- fread(aData.getArray(),nBytesToRead,1,m_tmpfl);
+ if (fread(aData.getArray(),nBytesToRead,1,m_tmpfl) != 1)
+ throw IOException();
+
epos = ftell(m_tmpfl);
return sal_Int32(epos-bpos);
}
-sal_Int32 SAL_CALL FTPInputStream::readSomeBytes( Sequence< sal_Int8 >& aData,sal_Int32 nMaxBytesToRead )
+sal_Int32 SAL_CALL FTPInputStream::readSomeBytes( Sequence< sal_Int8 >& aData,
+ sal_Int32 nMaxBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
diff --git a/ucb/source/ucp/ftp/ftpintreq.cxx b/ucb/source/ucp/ftp/ftpintreq.cxx
index 1844036cba9d..cb0712f19f1a 100644
--- a/ucb/source/ucp/ftp/ftpintreq.cxx
+++ b/ucb/source/ucp/ftp/ftpintreq.cxx
@@ -101,7 +101,6 @@ bool XInteractionApproveImpl::isSelected() const
}
-
// XInteractionDisapproveImpl
XInteractionDisapproveImpl::XInteractionDisapproveImpl()
@@ -156,13 +155,6 @@ void SAL_CALL XInteractionDisapproveImpl::select()
}
-bool XInteractionDisapproveImpl::isSelected() const
-{
- return m_bSelected;
-}
-
-
-
// XInteractionRequestImpl
XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
@@ -234,12 +226,6 @@ XInteractionRequestImpl::getContinuations( )
}
-bool XInteractionRequestImpl::aborted() const
-{
- return p2->isSelected();
-}
-
-
bool XInteractionRequestImpl::approved() const
{
return p1->isSelected();
diff --git a/ucb/source/ucp/ftp/ftpintreq.hxx b/ucb/source/ucp/ftp/ftpintreq.hxx
index 3b26b2c57162..6d335f22ef83 100644
--- a/ucb/source/ucp/ftp/ftpintreq.hxx
+++ b/ucb/source/ucp/ftp/ftpintreq.hxx
@@ -118,8 +118,6 @@ namespace ftp {
virtual void SAL_CALL select()
throw (com::sun::star::uno::RuntimeException);
- bool isSelected() const;
-
private:
bool m_bSelected;
@@ -166,8 +164,6 @@ namespace ftp {
getContinuations( )
throw (com::sun::star::uno::RuntimeException);
- bool aborted() const;
-
bool approved() const;
private:
diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx
index ab18061de31a..696107238339 100644
--- a/ucb/source/ucp/ftp/ftpresultsetI.cxx
+++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx
@@ -38,7 +38,7 @@
#include "com/sun/star/ucb/XCommandProcessor.hpp"
#include "com/sun/star/sdbc/XRow.hpp"
#include "ftpresultsetI.hxx"
-
+#include "ftpcontent.hxx"
using namespace std;
@@ -96,6 +96,10 @@ ResultSetI::ResultSetI(const Reference<XMultiServiceFactory>& xMSF,
else if(Name.compareToAscii("DateCreated") == 0)
xRow->appendTimestamp(seqProp[i],
dirvec[n].m_aDate);
+ else if(Name.compareToAscii("CreatableContentsInfo") == 0)
+ xRow->appendObject(
+ seqProp[i],
+ makeAny(FTPContent::queryCreatableContentsInfo_Static()));
else
xRow->appendVoid(seqProp[i]);
}
diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx
index 420b3f993f4f..52615e79f90e 100644
--- a/ucb/source/ucp/ftp/ftpurl.cxx
+++ b/ucb/source/ucp/ftp/ftpurl.cxx
@@ -163,19 +163,18 @@ void FTPURL::parse(const rtl::OUString& url)
rtl::OString aIdent(url.getStr(),
url.getLength(),
RTL_TEXTENCODING_UTF8);
- char *buffer = new char[1+aIdent.getLength()];
-
- const char* p2 = aIdent.getStr();
rtl::OString lower = aIdent.toAsciiLowerCase();
if(lower.getLength() < 6 ||
strncmp("ftp://",lower.getStr(),6))
throw malformed_exception();
+ char *buffer = new char[1+aIdent.getLength()];
+ const char* p2 = aIdent.getStr();
p2 += 6;
char ch;
- char *p1 = buffer; // determine "username:password@host:port"
+ char *p1 = buffer; // determine "username:password@host:port"
while((ch = *p2++) != '/' && ch)
*p1++ = ch;
*p1 = 0;
@@ -393,7 +392,7 @@ namespace ftp {
#define SET_DATA_CONTAINER \
- curl_easy_setopt(curl,CURLOPT_NOBODY,false); \
+ curl_easy_setopt(curl,CURLOPT_NOBODY,false); \
MemoryContainer data; \
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,memory_write); \
curl_easy_setopt(curl,CURLOPT_WRITEDATA,&data)
@@ -590,6 +589,12 @@ rtl::OUString FTPURL::net_title() const
// the client should retry after getting the correct
// username + password
throw curl_exception(err);
+#if LIBCURL_VERSION_NUM>=0x070d01 /* 7.13.1 */
+ else if(err == CURLE_LOGIN_DENIED)
+ // the client should retry after getting the correct
+ // username + password
+ throw curl_exception(err);
+#endif
else if(try_more && err == CURLE_FTP_ACCESS_DENIED) {
// We were either denied access when trying to login to
// an FTP server or when trying to change working directory
@@ -665,8 +670,8 @@ void FTPURL::insert(bool replaceExisting,void* stream) const
throw(curl_exception)
{
if(!replaceExisting) {
-// FTPDirentry aDirentry(direntry());
-// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN)
+// FTPDirentry aDirentry(direntry());
+// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN)
// throw curl_exception(FILE_EXIST_DURING_INSERT);
throw curl_exception(FILE_MIGHT_EXIST_DURING_INSERT);
} // else
@@ -716,8 +721,8 @@ void FTPURL::mkdir(bool ReplaceExisting) const
FTPDirentry aDirentry(direntry());
if(!ReplaceExisting) {
-// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
-// throw curl_exception(FOLDER_EXIST_DURING_INSERT);
+// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
+// throw curl_exception(FOLDER_EXIST_DURING_INSERT);
throw curl_exception(FOLDER_MIGHT_EXIST_DURING_INSERT);
} else if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
slist = curl_slist_append(slist,aDel.getStr());