LibreOffice Module ucb (master) 1
ftpcontent.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21/**************************************************************************
22 TODO
23 **************************************************************************
24
25 *************************************************************************/
26#include <com/sun/star/beans/PropertyAttribute.hpp>
27
28#include "ftpdynresultset.hxx"
30#include "ftpresultsetI.hxx"
31#include "ftpcontent.hxx"
33#include "ftpdirp.hxx"
35#include "ftpintreq.hxx"
36
37#include <memory>
38#include <utility>
39#include <vector>
40#include <string.h>
41#include "curl.hxx"
50#include <com/sun/star/lang/IllegalAccessException.hpp>
51#include <com/sun/star/lang/NoSupportException.hpp>
52#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
53#include <com/sun/star/ucb/UnsupportedCommandException.hpp>
54#include <com/sun/star/beans/IllegalTypeException.hpp>
55#include <com/sun/star/beans/UnknownPropertyException.hpp>
56#include <com/sun/star/beans/Property.hpp>
57#include <com/sun/star/ucb/XCommandInfo.hpp>
58#include <com/sun/star/io/BufferSizeExceededException.hpp>
59#include <com/sun/star/io/IOException.hpp>
60#include <com/sun/star/io/NotConnectedException.hpp>
61#include <com/sun/star/io/XActiveDataSink.hpp>
62#include <com/sun/star/io/XOutputStream.hpp>
63#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
64#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
65#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
66#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
67#include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp>
68#include <com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp>
69#include <com/sun/star/ucb/InteractiveIOException.hpp>
70#include <com/sun/star/ucb/MissingPropertiesException.hpp>
71#include <com/sun/star/ucb/MissingInputStreamException.hpp>
72#include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
73#include <com/sun/star/ucb/OpenMode.hpp>
74#include <com/sun/star/ucb/IOErrorCode.hpp>
75
76using namespace ftp;
77using namespace com::sun::star::task;
78using namespace com::sun::star::container;
79using namespace com::sun::star::lang;
80using namespace com::sun::star::uno;
81using namespace com::sun::star::ucb;
82using namespace com::sun::star::beans;
83using namespace com::sun::star::io;
84using namespace com::sun::star::sdbc;
85
86
87// Content Implementation.
88
89FTPContent::FTPContent( const Reference< XComponentContext >& rxContext,
90 FTPContentProvider* pProvider,
91 const Reference< XContentIdentifier >& Identifier,
92 const FTPURL& aFTPURL)
93 : ContentImplHelper(rxContext,pProvider,Identifier)
94 , m_pFCP(pProvider)
95 , m_aFTPURL(aFTPURL)
96 , m_bInserted(false)
97 , m_bTitleSet(false)
98{
99}
100
101FTPContent::FTPContent( const Reference< XComponentContext >& rxContext,
102 FTPContentProvider* pProvider,
103 const Reference< XContentIdentifier >& Identifier,
104 ContentInfo Info)
105 : ContentImplHelper(rxContext,pProvider,Identifier)
106 , m_pFCP(pProvider)
107 , m_aFTPURL(Identifier->getContentIdentifier(), pProvider)
108 , m_bInserted(true)
109 , m_bTitleSet(false)
110 , m_aInfo(std::move(Info))
111{
112}
113
114FTPContent::~FTPContent()
115{
116}
117
118// XInterface methods.
119
120void SAL_CALL FTPContent::acquire()
121 noexcept
122{
123 OWeakObject::acquire();
124}
125
126void SAL_CALL FTPContent::release()
127 noexcept
128{
129 OWeakObject::release();
130}
131
132css::uno::Any SAL_CALL FTPContent::queryInterface( const css::uno::Type & rType )
133{
134 css::uno::Any aRet = cppu::queryInterface( rType,
135 static_cast< XTypeProvider* >(this),
136 static_cast< XServiceInfo* >(this),
137 static_cast< XContent* >(this),
138 static_cast< XCommandProcessor* >(this),
139 static_cast< XContentCreator* >(this),
140 static_cast< XChild* >(this)
141 );
142 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
143}
144
145// XTypeProvider methods.
146
147css::uno::Sequence< sal_Int8 > SAL_CALL FTPContent::getImplementationId()
148{
149 return css::uno::Sequence<sal_Int8>();
150}
151
152css::uno::Sequence< css::uno::Type > SAL_CALL FTPContent::getTypes()
153{
154 static cppu::OTypeCollection s_aCollection(
161 );
162
163 return s_aCollection.getTypes();
164}
165
166
167// XServiceInfo methods.
168
170{
171 return "com.sun.star.comp.FTPContent";
172}
173
174sal_Bool SAL_CALL FTPContent::supportsService( const OUString& ServiceName )
175{
176 return cppu::supportsService( this, ServiceName );
177}
178
179css::uno::Sequence< OUString > SAL_CALL FTPContent::getSupportedServiceNames()
180{
181 return { "com.sun.star.ucb.FTPContent" };
182}
183
184
185// XContent methods.
186
187// virtual
188OUString SAL_CALL FTPContent::getContentType()
189{
190 return FTP_CONTENT_TYPE;
191}
192
193// XCommandProcessor methods.
194
195//virtual
196void SAL_CALL FTPContent::abort( sal_Int32 /*CommandId*/ )
197{
198}
199
200
202 const Reference<XContentProvider >& xProvider,
203 const Sequence<Property>& seq,
204 std::vector<FTPDirentry>&& dirvec)
205 : m_xContext(rxContext),
206 m_xProvider(xProvider),
207 m_seq(seq),
208 m_dirvec(std::move(dirvec))
209{
210}
211
212
214{
215 return new ResultSetI(m_xContext,
217 m_seq,
218 m_dirvec);
219}
220
221
222// XCommandProcessor methods.
223
224namespace {
225
226enum ACTION { NOACTION,
227 THROWAUTHENTICATIONREQUEST,
228 THROWACCESSDENIED,
229 THROWINTERACTIVECONNECT,
230 THROWMALFORMED,
231 THROWRESOLVENAME,
232 THROWQUOTE,
233 THROWNOFILE,
234 THROWGENERAL };
235
236}
237
238// virtual
239Any SAL_CALL FTPContent::execute( const Command& aCommand,
240 sal_Int32 /*CommandId*/,
241 const Reference<
242 XCommandEnvironment >& Environment)
243{
244 ACTION action(NOACTION);
245 Any aRet;
246
247 while(true)
248 {
249 try
250 {
251 if(action == THROWAUTHENTICATIONREQUEST)
252 {
253 // try to get a continuation first
254 OUString aPassword,aAccount;
256 m_aFTPURL.port(),
258 aPassword,
259 aAccount);
262 m_aFTPURL.ident(false, false),
263 m_aFTPURL.host(), // ServerName
265 OUString(),
267 ::ENTITY_FIXED,
270 ::ENTITY_MODIFY,
271 aPassword));
272
273 Reference<XInteractionHandler> xInteractionHandler;
274 if(Environment.is())
275 xInteractionHandler =
276 Environment->getInteractionHandler();
277
278 if( xInteractionHandler.is()) {
279 xInteractionHandler->handle(p);
280
281 Reference<XInterface> xSelection(
282 p->getSelection());
283
285 xSelection,UNO_QUERY).is())
286 action = NOACTION;
288 xSelection,UNO_QUERY).is()) {
290 m_aFTPURL.host(),
291 m_aFTPURL.port(),
293 p->getAuthenticationSupplier()->getPassword(),
294 aAccount);
295 action = NOACTION;
296 }
297 }
298 aRet = p->getRequest();
299 }
300
301// if(aCommand.Name.equalsAscii(
302// "getPropertyValues") &&
303// action != NOACTION) {
304// // It is not allowed to throw if
305// // command is getPropertyValues
306// rtl::Reference<ucbhelper::PropertyValueSet> xRow =
307// new ucbhelper::PropertyValueSet(m_xSMgr);
308// Sequence<Property> Properties;
309// aCommand.Argument >>= Properties;
310// for(int i = 0; i < Properties.getLength(); ++i)
311// xRow->appendVoid(Properties[i]);
312// aRet <<= Reference<XRow>(xRow.get());
313// return aRet;
314// }
315
316 switch (action)
317 {
318 case NOACTION:
319 break;
320
321 case THROWAUTHENTICATIONREQUEST:
323 aRet,
325 break;
326
327 case THROWACCESSDENIED:
328 {
330 {
331 {"Uri", Any(m_aFTPURL.ident(false,false))}
332 }));
334 IOErrorCode_ACCESS_DENIED,
335 seq,
337 break;
338 }
339 case THROWINTERACTIVECONNECT:
340 {
341 InteractiveNetworkConnectException excep;
342 excep.Server = m_aFTPURL.host();
343 aRet <<= excep;
345 aRet,
347 break;
348 }
349 case THROWMALFORMED:
350 {
351 IllegalIdentifierException ex;
352 aRet <<= ex;
354 aRet,
356 break;
357 }
358 case THROWRESOLVENAME:
359 {
360 InteractiveNetworkResolveNameException excep;
361 excep.Server = m_aFTPURL.host();
362 aRet <<= excep;
364 aRet,
366 break;
367 }
368 case THROWNOFILE:
369 {
371 {
372 {"Uri", Any(m_aFTPURL.ident(false,false))}
373 }));
375 IOErrorCode_NO_FILE,
376 seq,
378 break;
379 }
380 case THROWQUOTE:
381 case THROWGENERAL:
383 IOErrorCode_GENERAL,
384 Sequence<Any>(0),
386 break;
387 }
388
389 if(aCommand.Name == "getPropertyValues") {
391 if(!(aCommand.Argument >>= Properties))
392 {
393 aRet <<= IllegalArgumentException(
394 "Wrong argument type!",
395 static_cast< cppu::OWeakObject * >(this),
396 -1);
398 }
399
401 }
402 else if(aCommand.Name == "setPropertyValues")
403 {
404 Sequence<PropertyValue> propertyValues;
405
406 if( ! ( aCommand.Argument >>= propertyValues ) ) {
407 aRet <<= IllegalArgumentException(
408 "Wrong argument type!",
409 static_cast< cppu::OWeakObject * >(this),
410 -1);
412 }
413
414 aRet <<= setPropertyValues(propertyValues);
415 }
416 else if(aCommand.Name == "getCommandInfo") {
417 // Note: Implemented by base class.
418 aRet <<= getCommandInfo(Environment);
419 }
420 else if(aCommand.Name == "getPropertySetInfo") {
421 // Note: Implemented by base class.
423 }
424 else if(aCommand.Name == "insert")
425 {
426 InsertCommandArgument aInsertArgument;
427 if ( ! ( aCommand.Argument >>= aInsertArgument ) ) {
428 aRet <<= IllegalArgumentException(
429 "Wrong argument type!",
430 static_cast< cppu::OWeakObject * >(this),
431 -1);
433 }
434 insert(aInsertArgument,Environment);
435 }
436 else if(aCommand.Name == "delete") {
437 m_aFTPURL.del();
438 deleted();
439 }
440 else if(aCommand.Name == "open") {
441 OpenCommandArgument2 aOpenCommand;
442 if ( !( aCommand.Argument >>= aOpenCommand ) ) {
443 aRet <<= IllegalArgumentException(
444 "Wrong argument type!",
445 static_cast< cppu::OWeakObject * >(this),
446 -1);
447
449 }
450
451 if(aOpenCommand.Mode == OpenMode::DOCUMENT) {
452 // Open as a document
454 xActiveDataSink(aOpenCommand.Sink,UNO_QUERY);
456 xOutputStream(aOpenCommand.Sink,UNO_QUERY);
457
458 if(xActiveDataSink.is()) {
459 xActiveDataSink->setInputStream(
461 }
462 else if(xOutputStream.is()) {
465 for (;;) {
466 Sequence<sal_Int8> byte_seq(4096);
467 sal_Int32 n = xStream->readBytes(byte_seq, 4096);
468 if (n == 0) {
469 break;
470 }
471 try {
472 if(byte_seq.getLength() != n)
473 byte_seq.realloc(n);
474 xOutputStream->writeBytes(byte_seq);
475 } catch(const NotConnectedException&) {
476
477 } catch(const BufferSizeExceededException&) {
478
479 } catch(const IOException&) {
480
481 }
482 }
483 }
484 else {
485 aRet <<= UnsupportedDataSinkException(
486 OUString(),
487 static_cast< cppu::OWeakObject * >(this),
488 aOpenCommand.Sink);
490 }
491 }
492 else if(aOpenCommand.Mode == OpenMode::ALL ||
493 aOpenCommand.Mode == OpenMode::DOCUMENTS ||
494 aOpenCommand.Mode == OpenMode::FOLDERS ) {
495 std::vector<FTPDirentry> resvec =
496 m_aFTPURL.list(sal_Int16(aOpenCommand.Mode));
498 = new DynamicResultSet(
500 aOpenCommand,
501 std::make_unique<ResultSetFactory>(m_xContext,
502 m_xProvider.get(),
503 aOpenCommand.Properties,
504 std::move(resvec)));
505 aRet <<= xSet;
506 }
507 else if(aOpenCommand.Mode ==
508 OpenMode::DOCUMENT_SHARE_DENY_NONE ||
509 aOpenCommand.Mode ==
510 OpenMode::DOCUMENT_SHARE_DENY_WRITE) {
511 // Unsupported OpenMode
512 aRet <<= UnsupportedOpenModeException(
513 OUString(),
514 static_cast< cppu::OWeakObject * >(this),
515 static_cast< sal_Int16 >(aOpenCommand.Mode));
517 }
518 else {
519 aRet <<= IllegalArgumentException(
520 "Unexpected OpenMode!",
521 static_cast< cppu::OWeakObject * >(this),
522 -1);
523
525 }
526 } else if(aCommand.Name == "createNewContent") {
527 ContentInfo aArg;
528 if (!(aCommand.Argument >>= aArg)) {
530 Any(
531 IllegalArgumentException(
532 "Wrong argument type!",
533 static_cast< cppu::OWeakObject * >(this),
534 -1)),
536 // Unreachable
537 }
538 aRet <<= createNewContent(aArg);
539 } else {
540 aRet <<= UnsupportedCommandException(
541 aCommand.Name,
542 static_cast< cppu::OWeakObject * >(this));
544 }
545
546 return aRet;
547 }
548 catch(const curl_exception& e)
549 {
550 if(e.code() == CURLE_COULDNT_CONNECT)
551 action = THROWINTERACTIVECONNECT;
552 else if (e.code() == CURLE_URL_MALFORMAT)
553 {
554 action = THROWMALFORMED;
555 }
556 else if(e.code() == CURLE_COULDNT_RESOLVE_HOST )
557 action = THROWRESOLVENAME;
558 else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT ||
559 e.code() == CURLE_LOGIN_DENIED ||
560 e.code() == CURLE_BAD_PASSWORD_ENTERED ||
561 e.code() == CURLE_FTP_WEIRD_PASS_REPLY)
562 action = THROWAUTHENTICATIONREQUEST;
563 else if(e.code() == CURLE_FTP_ACCESS_DENIED)
564 action = THROWACCESSDENIED;
565 else if(e.code() == CURLE_FTP_QUOTE_ERROR)
566 action = THROWQUOTE;
567 else if(e.code() == CURLE_FTP_COULDNT_RETR_FILE)
568 action = THROWNOFILE;
569 else
570 // nothing known about the cause of the error
571 action = THROWGENERAL;
572 }
573 }
574}
575
576constexpr OUStringLiteral FTP_FILE = u"application/vnd.sun.staroffice.ftp-file";
577
578constexpr OUStringLiteral FTP_FOLDER = u"application/vnd.sun.staroffice.ftp-folder";
579
582{
584}
585
586// static
589{
591 "Title",
592 -1,
594 PropertyAttribute::MAYBEVOID
595 | PropertyAttribute::BOUND ) };
596 return
597 {
598 { FTP_FILE, ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | ContentInfoAttribute::KIND_DOCUMENT, props },
599 { FTP_FOLDER, ContentInfoAttribute::KIND_FOLDER, props }
600 };
601}
602
605{
606 if( Info.Type =="application/vnd.sun.staroffice.ftp-file" || Info.Type == "application/vnd.sun.staroffice.ftp-folder" )
607 return new FTPContent(m_xContext,
608 m_pFCP,
610 else
611 return Reference<XContent>(nullptr);
612}
613
614
617{
620 return Reference<XInterface>( m_xProvider->queryContent(xIdent), UNO_QUERY );
621}
622
623
624void SAL_CALL
626{
627 throw NoSupportException();
628}
629
630
632{
633 return m_aFTPURL.parent();
634}
635
636namespace {
637
638class InsertData
639 : public CurlInput {
640
641public:
642
643 explicit InsertData(const Reference<XInputStream>& xInputStream)
644 : m_xInputStream(xInputStream) { }
645 virtual ~InsertData() {}
646
647 // returns the number of bytes actually read
648 virtual sal_Int32 read(sal_Int8 *dest,sal_Int32 nBytesRequested) override;
649
650private:
651
652 Reference<XInputStream> m_xInputStream;
653};
654
655}
656
657sal_Int32 InsertData::read(sal_Int8 *dest,sal_Int32 nBytesRequested)
658{
659 sal_Int32 m = 0;
660
661 if(m_xInputStream.is()) {
662 Sequence<sal_Int8> seq(nBytesRequested);
663 m = m_xInputStream->readBytes(seq,nBytesRequested);
664 memcpy(dest,seq.getConstArray(),m);
665 }
666 return m;
667}
668
669
670void FTPContent::insert(const InsertCommandArgument& aInsertCommand,
672{
673 osl::MutexGuard aGuard(m_aMutex);
674
675 if(m_bInserted && !m_bTitleSet) {
676 MissingPropertiesException excep;
677 excep.Properties = { "Title" };
679 }
680
681 if(m_bInserted &&
682 m_aInfo.Type == FTP_FILE &&
683 !aInsertCommand.Data.is())
684 {
685 MissingInputStreamException excep;
687 }
688
689 bool bReplace(aInsertCommand.ReplaceExisting);
690
691 retry:
692 try {
693 if(m_aInfo.Type == FTP_FILE) {
694 InsertData data(aInsertCommand.Data);
695 m_aFTPURL.insert(bReplace,&data);
696 } else if(m_aInfo.Type == FTP_FOLDER)
697 m_aFTPURL.mkdir(bReplace);
698 } catch(const curl_exception& e) {
701 // Interact
703 if(Env.is())
704 xInt = Env->getInteractionHandler();
705
706 UnsupportedNameClashException excep;
707 excep.NameClash = 0; //NameClash::ERROR;
708
709 if(!xInt.is()) {
711 }
712
714 const Reference<XInteractionRequest>& xReq(request.getRequest());
715 xInt->handle(xReq);
716 if (request.approved()) {
717 bReplace = true;
718 goto retry;
719 }
720 else
721 throw excep;
722 }
723 else
724 throw;
725 }
726
727 // May not be reached, because both mkdir and insert can throw curl-
728 // exceptions
729 m_bInserted = false;
730 inserted();
731}
732
733
735 const Sequence< Property >& seqProp
736)
737{
740
741 FTPDirentry aDirEntry = m_aFTPURL.direntry();
742
743 for(const auto& rProp : seqProp) {
744 const OUString& Name = rProp.Name;
745 if(Name == "Title")
746 xRow->appendString(rProp,aDirEntry.m_aName);
747 else if(Name == "CreatableContentsInfo")
748 xRow->appendObject(rProp,
750 else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) {
751 if(Name == "ContentType")
752 xRow->appendString(rProp,
754 ? OUString(FTP_FOLDER)
755 : OUString(FTP_FILE) );
756 else if(Name == "IsReadOnly")
757 xRow->appendBoolean(rProp,
758 (aDirEntry.m_nMode
760 else if(Name == "IsDocument")
761 xRow->appendBoolean(rProp,
762 (aDirEntry.m_nMode &
764 else if(Name == "IsFolder")
765 xRow->appendBoolean(rProp,
766 (aDirEntry.m_nMode &
768 else if(Name == "Size")
769 xRow->appendLong(rProp,
770 aDirEntry.m_nSize);
771 else if(Name == "DateCreated")
772 xRow->appendTimestamp(rProp,
773 aDirEntry.m_aDate);
774 else
775 xRow->appendVoid(rProp);
776 } else
777 xRow->appendVoid(rProp);
778 }
779
780 return xRow;
781}
782
783
785 const Sequence<PropertyValue>& seqPropVal)
786{
787 Sequence<Any> ret(seqPropVal.getLength());
788 auto retRange = asNonConstRange(ret);
790
791 osl::MutexGuard aGuard(m_aMutex);
792 for(sal_Int32 i = 0; i < ret.getLength(); ++i) {
793 if ( seqPropVal[i].Name == "Title" ) {
794 OUString Title;
795 if(!(seqPropVal[i].Value >>= Title)) {
796 retRange[i] <<= IllegalTypeException();
797 continue;
798 } else if(Title.isEmpty()) {
799 retRange[i] <<= IllegalArgumentException();
800 continue;
801 }
802
803 if(m_bInserted) {
806 new FTPContentIdentifier(m_aFTPURL.ident(false,false));
807 m_bTitleSet = true;
808 } else
809 try {
810 OUString OldTitle = m_aFTPURL.ren(Title);
811 evt = { { /* Source */ {},
812 /* PropertyName */ "Title",
813 /* Further */ false,
814 /* PropertyHandle */ -1,
815 /* OldValue */ Any(OldTitle),
816 /* NewValue */ Any(Title) } };
817 } catch(const curl_exception&) {
818 InteractiveIOException excep;
819 // any better possibility here?
820 // ( the error code is always CURLE_FTP_QUOTE_ERROR )
821 excep.Code = IOErrorCode_ACCESS_DENIED;
822 retRange[i] <<= excep;
823 }
824 } else {
827
828 // either unknown or read-only
829 retRange[i] <<= UnknownPropertyException();
830 const auto& rName = seqPropVal[i].Name;
831 auto pProp = std::find_if(props.begin(), props.end(),
832 [&rName](const Property& rProp) { return rProp.Name == rName; });
833 if (pProp != props.end()) {
834 retRange[i] <<= IllegalAccessException(
835 "Property is read-only!",
836 //props[j].Attributes & PropertyAttribute::READONLY
837 // ? "Property is read-only!"
838 // : "Access denied!"),
839 static_cast< cppu::OWeakObject * >( this ));
840 }
841 }
842 }
843
844 if(evt.hasElements()) {
845 // title has changed
847 (void)exchange(new FTPContentIdentifier(m_aFTPURL.ident(false,false)));
848 }
849
850 return ret;
851}
852
853/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XComponentContext > m_xContext
Reference< XInputStream > xStream
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
void forHost(std::u16string_view host, std::u16string_view port, std::u16string_view username, OUString &password, OUString &account)
host is in the form host:port.
bool setHost(const OUString &host, const OUString &port, const OUString &username, const OUString &password, const OUString &account)
css::uno::Sequence< css::uno::Any > setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &seqPropVal)
Definition: ftpcontent.cxx:784
FTPContentProvider * m_pFCP
Definition: ftpcontent.hxx:111
virtual css::uno::Sequence< css::ucb::ContentInfo > SAL_CALL queryCreatableContentsInfo() override
Definition: ftpcontent.cxx:581
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: ftpcontent.cxx:152
virtual void SAL_CALL release() noexcept override
Definition: ftpcontent.cxx:126
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL createNewContent(const css::ucb::ContentInfo &Info) override
Definition: ftpcontent.cxx:604
css::ucb::ContentInfo m_aInfo
Definition: ftpcontent.hxx:115
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: ftpcontent.cxx:625
virtual void SAL_CALL acquire() noexcept override
Definition: ftpcontent.cxx:120
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: ftpcontent.cxx:132
virtual css::uno::Any SAL_CALL execute(const css::ucb::Command &aCommand, sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &Environment) override
Definition: ftpcontent.cxx:239
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo_Static()
Definition: ftpcontent.cxx:588
virtual css::uno::Sequence< css::beans::Property > getProperties(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv) override
virtual OUString SAL_CALL getContentType() override
Definition: ftpcontent.cxx:188
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ftpcontent.cxx:174
FTPContent(const css::uno::Reference< css::uno::XComponentContext > &rxContext, FTPContentProvider *pProvider, const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier, const FTPURL &FtpUrl)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: ftpcontent.cxx:147
void insert(const css::ucb::InsertCommandArgument &, const css::uno::Reference< css::ucb::XCommandEnvironment > &)
Definition: ftpcontent.cxx:670
virtual OUString SAL_CALL getImplementationName() override
Definition: ftpcontent.cxx:169
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: ftpcontent.cxx:616
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ftpcontent.cxx:179
css::uno::Reference< css::sdbc::XRow > getPropertyValues(const css::uno::Sequence< css::beans::Property > &seqProp)
Definition: ftpcontent.cxx:734
virtual OUString getParentURL() override
Definition: ftpcontent.cxx:631
virtual void SAL_CALL abort(sal_Int32 CommandId) override
Definition: ftpcontent.cxx:196
void insert(bool ReplaceExisting, void *stream) const
Definition: ftpurl.cxx:638
oslFileHandle open()
Definition: ftpurl.cxx:391
const OUString & port() const
Definition: ftpurl.hxx:89
OUString parent(bool internal=false) const
returns the parent url.
Definition: ftpurl.cxx:289
FTPDirentry direntry() const
Definition: ftpurl.cxx:593
std::vector< FTPDirentry > list(sal_Int16 nMode) const
Definition: ftpurl.cxx:428
const OUString & username() const
Definition: ftpurl.hxx:91
OUString ren(const OUString &NewTitle)
Definition: ftpurl.cxx:718
const OUString & host() const
Definition: ftpurl.hxx:87
OUString ident(bool withslash, bool internal) const
This returns the URL, but cleaned from unnecessary ellipses.
Definition: ftpurl.cxx:240
void mkdir(bool ReplaceExisting) const
Definition: ftpurl.cxx:669
void child(const OUString &title)
sets the unencoded title
Definition: ftpurl.cxx:341
void del() const
Definition: ftpurl.cxx:758
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
ResultSetFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::ucb::XContentProvider > &xProvider, const css::uno::Sequence< css::beans::Property > &seq, std::vector< FTPDirentry > &&dirvec)
Definition: ftpcontent.cxx:201
std::vector< FTPDirentry > m_dirvec
css::uno::Sequence< css::beans::Property > m_seq
rtl::Reference< ResultSetBase > createResultSet()
Definition: ftpcontent.cxx:213
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::task::XInteractionRequest > const & getRequest() const
Definition: ftpintreq.hxx:66
sal_Int32 code() const
Definition: ftpurl.hxx:56
css::uno::Reference< css::ucb::XCommandInfo > getCommandInfo(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv, bool bCache=true)
rtl::Reference< ContentProviderImplHelper > m_xProvider
bool exchange(const css::uno::Reference< css::ucb::XContentIdentifier > &rNewId)
css::uno::Reference< css::beans::XPropertySetInfo > getPropertySetInfo(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv, bool bCache=true)
css::uno::Reference< css::ucb::XContentIdentifier > m_xIdentifier
css::uno::Reference< css::uno::XComponentContext > m_xContext
void notifyPropertiesChange(const css::uno::Sequence< css::beans::PropertyChangeEvent > &evt) const
float u
constexpr OUStringLiteral FTP_FOLDER
Definition: ftpcontent.cxx:578
constexpr OUStringLiteral FTP_FILE
Definition: ftpcontent.cxx:576
constexpr OUStringLiteral FTP_CONTENT_TYPE
void * p
sal_Int64 n
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Info
Value
Definition of ftpcontentprovider.
@ FOLDER_MIGHT_EXIST_DURING_INSERT
Definition: ftpurl.hxx:44
@ FILE_MIGHT_EXIST_DURING_INSERT
Definition: ftpurl.hxx:45
@ INETCOREFTP_FILEMODE_ISDIR
Definition: ftpdirp.hxx:67
@ INETCOREFTP_FILEMODE_UNKNOWN
Definition: ftpdirp.hxx:64
@ INETCOREFTP_FILEMODE_WRITE
Definition: ftpdirp.hxx:66
int i
m
Title
action
dictionary props
void cancelCommandExecution(const uno::Any &rException, const uno::Reference< ucb::XCommandEnvironment > &xEnv)
DateTime m_aDate
Definition: ftpdirp.hxx:74
OUString m_aName
Definition: ftpdirp.hxx:73
sal_uInt32 m_nMode
Definition: ftpdirp.hxx:75
sal_uInt32 m_nSize
Definition: ftpdirp.hxx:76
OUString aCommand
OUString Name
unsigned char sal_Bool
signed char sal_Int8