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