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