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