LibreOffice Module ucb (master)  1
FileAccess.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 #include <cppuhelper/exc_hlp.hxx>
22 #include <comphelper/sequence.hxx>
23 #include <cppuhelper/factory.hxx>
24 #include <cppuhelper/implbase.hxx>
26 
27 #include <tools/urlobj.hxx>
28 #include <ucbhelper/content.hxx>
29 #include <unotools/streamwrap.hxx>
30 #include <tools/stream.hxx>
31 
32 #include <com/sun/star/beans/Property.hpp>
33 #include <com/sun/star/container/XChild.hpp>
34 #include <com/sun/star/io/XActiveDataSink.hpp>
35 #include <com/sun/star/io/XActiveDataStreamer.hpp>
36 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/sdbc/XResultSet.hpp>
39 #include <com/sun/star/ucb/ContentCreationException.hpp>
40 #include <com/sun/star/ucb/CommandFailedException.hpp>
41 #include <com/sun/star/ucb/ContentInfo.hpp>
42 #include <com/sun/star/ucb/ContentInfoAttribute.hpp>
43 #include <com/sun/star/ucb/InsertCommandArgument.hpp>
44 #include <com/sun/star/ucb/InteractiveIOException.hpp>
45 #include <com/sun/star/ucb/NameClash.hpp>
46 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
47 #include <com/sun/star/ucb/OpenMode.hpp>
48 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
49 #include <com/sun/star/ucb/XContent.hpp>
50 #include <com/sun/star/ucb/XContentAccess.hpp>
51 #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
52 #include <com/sun/star/util/theMacroExpander.hpp>
53 
54 #include <vector>
55 
56 #include "FileAccess.hxx"
57 
58 #define SERVICE_NAME "com.sun.star.ucb.SimpleFileAccess"
59 
60 using namespace ::com::sun::star::uno;
61 using namespace ::com::sun::star::lang;
62 using namespace ::com::sun::star::io;
63 using namespace ::com::sun::star::ucb;
64 using namespace ::com::sun::star::sdbc;
65 using namespace ::com::sun::star::task;
66 using namespace ::com::sun::star::util;
67 using namespace ::com::sun::star::beans;
68 using namespace ::com::sun::star::registry;
69 using namespace ::com::sun::star::container;
70 
71 using ::std::vector;
72 
73 namespace
74 {
75 
76 // Implementation XSimpleFileAccess
77 typedef cppu::WeakImplHelper<XSimpleFileAccess3, css::lang::XServiceInfo>
78  FileAccessHelper;
79 class OCommandEnvironment;
80 
81 class OFileAccess : public FileAccessHelper
82 {
85 
89  void transferImpl( const OUString& rSource, const OUString& rDest, bool bMoveData );
91  bool createNewFile( const OUString & rParentURL,
92  const OUString & rTitle,
93  const Reference< XInputStream >& data );
94 
95 public:
96  explicit OFileAccess( const Reference< XComponentContext > & xContext )
97  : m_xContext( xContext) {}
98  // Methods
99  virtual void SAL_CALL copy( const OUString& SourceURL, const OUString& DestURL ) override;
100  virtual void SAL_CALL move( const OUString& SourceURL, const OUString& DestURL ) override;
101  virtual void SAL_CALL kill( const OUString& FileURL ) override;
102  virtual sal_Bool SAL_CALL isFolder( const OUString& FileURL ) override;
103  virtual sal_Bool SAL_CALL isReadOnly( const OUString& FileURL ) override;
104  virtual void SAL_CALL setReadOnly( const OUString& FileURL, sal_Bool bReadOnly ) override;
105  virtual void SAL_CALL createFolder( const OUString& NewFolderURL ) override;
106  virtual sal_Int32 SAL_CALL getSize( const OUString& FileURL ) override;
107  virtual OUString SAL_CALL getContentType( const OUString& FileURL ) override;
108  virtual css::util::DateTime SAL_CALL getDateTimeModified( const OUString& FileURL ) override;
109  virtual css::uno::Sequence< OUString > SAL_CALL getFolderContents( const OUString& FolderURL, sal_Bool bIncludeFolders ) override;
110  virtual sal_Bool SAL_CALL exists( const OUString& FileURL ) override;
111  virtual css::uno::Reference< css::io::XInputStream > SAL_CALL openFileRead( const OUString& FileURL ) override;
112  virtual css::uno::Reference< css::io::XOutputStream > SAL_CALL openFileWrite( const OUString& FileURL ) override;
113  virtual css::uno::Reference< css::io::XStream > SAL_CALL openFileReadWrite( const OUString& FileURL ) override;
114  virtual void SAL_CALL setInteractionHandler( const css::uno::Reference< css::task::XInteractionHandler >& Handler ) override;
115  virtual void SAL_CALL writeFile( const OUString& FileURL, const css::uno::Reference< css::io::XInputStream >& data ) override;
116  virtual sal_Bool SAL_CALL isHidden( const OUString& FileURL ) override;
117  virtual void SAL_CALL setHidden( const OUString& FileURL, sal_Bool bHidden ) override;
118 
119  OUString SAL_CALL getImplementationName() override
120  { return IMPLEMENTATION_NAME; }
121 
122  sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
123  { return cppu::supportsService(this, ServiceName); }
124 
125  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
127 };
128 
129 // Implementation XActiveDataSink
130 
131 class OActiveDataSink : public cppu::WeakImplHelper< XActiveDataSink >
132 {
133  Reference< XInputStream > mxStream;
134 
135 public:
136 
137  // Methods
138  virtual void SAL_CALL setInputStream( const Reference< XInputStream >& aStream ) override;
139  virtual Reference< XInputStream > SAL_CALL getInputStream( ) override;
140 };
141 
142 // Implementation XActiveDataStreamer
143 
144 class OActiveDataStreamer : public cppu::WeakImplHelper< XActiveDataStreamer >
145 {
146  Reference< XStream > mxStream;
147 
148 public:
149 
150  // Methods
151  virtual void SAL_CALL setStream( const Reference< XStream >& aStream ) override;
152  virtual Reference< XStream > SAL_CALL getStream() override;
153 };
154 
155 // Implementation XCommandEnvironment
156 
157 class OCommandEnvironment : public cppu::WeakImplHelper< XCommandEnvironment >
158 {
159  Reference< XInteractionHandler > mxInteraction;
160 
161 public:
162  void setHandler( const Reference< XInteractionHandler >& xInteraction_ )
163  {
164  mxInteraction = xInteraction_;
165  }
166 
167  // Methods
168  virtual Reference< XInteractionHandler > SAL_CALL getInteractionHandler() override;
169  virtual Reference< XProgressHandler > SAL_CALL getProgressHandler() override;
170 };
171 
172 void OActiveDataSink::setInputStream( const Reference< XInputStream >& aStream )
173 {
174  mxStream = aStream;
175 }
176 
177 Reference< XInputStream > OActiveDataSink::getInputStream()
178 {
179  return mxStream;
180 }
181 
182 void OActiveDataStreamer::setStream( const Reference< XStream >& aStream )
183 {
184  mxStream = aStream;
185 }
186 
187 Reference< XStream > OActiveDataStreamer::getStream()
188 {
189  return mxStream;
190 }
191 
192 Reference< XInteractionHandler > OCommandEnvironment::getInteractionHandler()
193 {
194  return mxInteraction;
195 }
196 
197 Reference< XProgressHandler > OCommandEnvironment::getProgressHandler()
198 {
200  return xRet;
201 }
202 
203 void OFileAccess::transferImpl( const OUString& rSource,
204  const OUString& rDest,
205  bool bMoveData )
206 {
207  // SfxContentHelper::Transfer_Impl
208  INetURLObject aSourceObj( rSource, INetProtocol::File );
209  INetURLObject aDestObj( rDest, INetProtocol::File );
210  OUString aName = aDestObj.getName(
212  OUString aDestURL;
213  OUString aSourceURL = aSourceObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
214  if ( aDestObj.removeSegment() )
215  {
216  // hierarchical URL.
217 
218  aDestObj.setFinalSlash();
219  aDestURL = aDestObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
220  }
221  else
222  {
223  // non-hierarchical URL
224 
225  // #i29648#
226 
227 
228  if ( aDestObj.GetProtocol() == INetProtocol::VndSunStarExpand )
229  {
230  // Hack: Expand destination URL using Macro Expander and try again
231  // with the hopefully hierarchical expanded URL...
232 
233  try
234  {
235  Reference< XMacroExpander > xExpander = theMacroExpander::get(m_xContext);
236 
237  aDestURL = xExpander->expandMacros(
239  }
240  catch ( Exception const & )
241  {
242  css::uno::Any anyEx = cppu::getCaughtException();
243  throw css::lang::WrappedTargetRuntimeException(
244  "OFileAccess::transferrImpl - Unable to obtain destination folder URL!",
245  static_cast< cppu::OWeakObject * >( this ), anyEx );
246  }
247 
248  transferImpl( rSource, aDestURL, bMoveData );
249  return;
250  }
251 
252  throw RuntimeException(
253  "OFileAccess::transferrImpl - Unable to obtain destination folder URL!",
254  static_cast< cppu::OWeakObject * >( this ) );
255 
256  }
257 
258  ucbhelper::Content aDestPath( aDestURL, mxEnvironment.get(), comphelper::getProcessComponentContext() );
259  ucbhelper::Content aSrc ( aSourceURL, mxEnvironment.get(), comphelper::getProcessComponentContext() );
260 
261  try
262  {
263  aDestPath.transferContent(aSrc,
264  bMoveData
267  aName,
268  css::ucb::NameClash::OVERWRITE);
269  }
270  catch ( css::ucb::CommandFailedException const & )
271  {
272  // Interaction Handler already handled the error that has occurred...
273  }
274 }
275 
276 void OFileAccess::copy( const OUString& SourceURL, const OUString& DestURL )
277 {
278  transferImpl( SourceURL, DestURL, false );
279 }
280 
281 void OFileAccess::move( const OUString& SourceURL, const OUString& DestURL )
282 {
283  transferImpl( SourceURL, DestURL, true );
284 }
285 
286 void OFileAccess::kill( const OUString& FileURL )
287 {
288  // SfxContentHelper::Kill
289  INetURLObject aDeleteObj( FileURL, INetProtocol::File );
291  try
292  {
293  aCnt.executeCommand( "delete", makeAny( true ) );
294  }
295  catch ( css::ucb::CommandFailedException const & )
296  {
297  // Interaction Handler already handled the error that has occurred...
298  }
299 }
300 
301 sal_Bool OFileAccess::isFolder( const OUString& FileURL )
302 {
303  bool bRet = false;
304  try
305  {
306  INetURLObject aURLObj( FileURL, INetProtocol::File );
308  bRet = aCnt.isFolder();
309  }
310  catch (const Exception &) {}
311  return bRet;
312 }
313 
314 sal_Bool OFileAccess::isReadOnly( const OUString& FileURL )
315 {
316  INetURLObject aURLObj( FileURL, INetProtocol::File );
318  Any aRetAny = aCnt.getPropertyValue("IsReadOnly");
319  bool bRet = false;
320  aRetAny >>= bRet;
321  return bRet;
322 }
323 
324 void OFileAccess::setReadOnly( const OUString& FileURL, sal_Bool bReadOnly )
325 {
326  INetURLObject aURLObj( FileURL, INetProtocol::File );
328  aCnt.setPropertyValue("IsReadOnly", Any(bReadOnly) );
329 }
330 
331 void OFileAccess::createFolder( const OUString& NewFolderURL )
332 {
333  // Does the folder already exist?
334  if( NewFolderURL.isEmpty() || isFolder( NewFolderURL ) )
335  return;
336 
337  // SfxContentHelper::MakeFolder
338  INetURLObject aURL( NewFolderURL, INetProtocol::File );
340  if ( !aTitle.isEmpty() )
341  {
342  aURL.removeSegment();
343 
344  // Does the base folder exist? Otherwise create it first
345  OUString aBaseFolderURLStr = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
346  if( !isFolder( aBaseFolderURLStr ) )
347  {
348  createFolder( aBaseFolderURLStr );
349  }
350  }
351 
353 
354  const Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo();
355 
356  for ( const ContentInfo & rCurr : aInfo )
357  {
358  // Simply look for the first KIND_FOLDER...
359  if ( rCurr.Attributes & ContentInfoAttribute::KIND_FOLDER )
360  {
361  // Make sure the only required bootstrap property is "Title",
362  const Sequence< Property > & rProps = rCurr.Properties;
363  if ( rProps.getLength() != 1 )
364  continue;
365 
366  if ( rProps[ 0 ].Name != "Title" )
367  continue;
368 
369  Sequence<OUString> aNames { "Title" };
370  Sequence< Any > aValues(1);
371  Any* pValues = aValues.getArray();
372  pValues[0] <<= aTitle;
373 
374  ucbhelper::Content aNew;
375  try
376  {
377  if ( !aCnt.insertNewContent( rCurr.Type, aNames, aValues, aNew ) )
378  continue;
379 
380  // Success. We're done.
381  return;
382  }
383  catch ( css::ucb::CommandFailedException const & )
384  {
385  // Interaction Handler already handled the error that has occurred...
386  continue;
387  }
388  }
389  }
390 }
391 
392 sal_Int32 OFileAccess::getSize( const OUString& FileURL )
393 {
394  // SfxContentHelper::GetSize
395  sal_Int32 nSize = 0;
396  sal_Int64 nTemp = 0;
397  INetURLObject aObj( FileURL, INetProtocol::File );
399  aCnt.getPropertyValue( "Size" ) >>= nTemp;
400  nSize = static_cast<sal_Int32>(nTemp);
401  return nSize;
402 }
403 
404 OUString OFileAccess::getContentType( const OUString& FileURL )
405 {
406  INetURLObject aObj( FileURL, INetProtocol::File );
408 
409  Reference< XContent > xContent = aCnt.get();
410  OUString aTypeStr = xContent->getContentType();
411  return aTypeStr;
412 }
413 
414 css::util::DateTime OFileAccess::getDateTimeModified( const OUString& FileURL )
415 {
416  INetURLObject aFileObj( FileURL, INetProtocol::File );
417  css::util::DateTime aDateTime;
418 
421  aYoung.getPropertyValue("DateModified") >>= aDateTime;
422  return aDateTime;
423 }
424 
425 Sequence< OUString > OFileAccess::getFolderContents( const OUString& FolderURL, sal_Bool bIncludeFolders )
426 {
427  // SfxContentHelper::GetFolderContents
428 
429  std::vector<OUString> aFiles;
430  INetURLObject aFolderObj( FolderURL, INetProtocol::File );
431 
433  Reference< XResultSet > xResultSet;
434  Sequence< OUString > aProps(0);
435 
437 
438  try
439  {
440  xResultSet = aCnt.createCursor( aProps, eInclude );
441  }
442  catch ( css::ucb::CommandFailedException const & )
443  {
444  // Interaction Handler already handled the error that has occurred...
445  }
446 
447  if ( xResultSet.is() )
448  {
449  Reference< css::ucb::XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
450 
451  while ( xResultSet->next() )
452  {
453  OUString aId = xContentAccess->queryContentIdentifierString();
454  INetURLObject aURL( aId, INetProtocol::File );
455  aFiles.push_back( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
456  }
457  }
458 
459  return comphelper::containerToSequence(aFiles);
460 }
461 
462 sal_Bool OFileAccess::exists( const OUString& FileURL )
463 {
464  bool bRet = false;
465  try
466  {
467  bRet = isFolder( FileURL );
468  if( !bRet )
469  {
470  Reference< XInputStream > xStream = openFileRead( FileURL );
471  bRet = xStream.is();
472  if( bRet )
473  xStream->closeInput();
474  }
475  }
476  catch (const Exception &) {}
477  return bRet;
478 }
479 
480 Reference< XInputStream > OFileAccess::openFileRead( const OUString& FileURL )
481 {
483  INetURLObject aObj( FileURL, INetProtocol::File );
485 
486  Reference<XActiveDataSink> xSink = new OActiveDataSink;
487 
488  try
489  {
490  bool bRet = aCnt.openStream( xSink );
491  if( bRet )
492  xRet = xSink->getInputStream();
493  }
494  catch ( css::ucb::CommandFailedException const & )
495  {
496  // Interaction Handler already handled the error that has occurred...
497  }
498 
499  return xRet;
500 }
501 
502 Reference< XOutputStream > OFileAccess::openFileWrite( const OUString& FileURL )
503 {
504  Reference< XOutputStream > xRet;
505  Reference< XStream > xStream = OFileAccess::openFileReadWrite( FileURL );
506  if( xStream.is() )
507  xRet = xStream->getOutputStream();
508  return xRet;
509 }
510 
511 Reference< XStream > OFileAccess::openFileReadWrite( const OUString& FileURL )
512 {
513  Reference<XActiveDataStreamer> xSink = new OActiveDataStreamer;
514 
515  OpenCommandArgument2 aArg;
516  aArg.Mode = OpenMode::DOCUMENT;
517  aArg.Priority = 0; // unused
518  aArg.Sink = xSink;
519  aArg.Properties = Sequence< Property >( 0 ); // unused
520 
521  Any aCmdArg;
522  aCmdArg <<= aArg;
523 
524  INetURLObject aFileObj( FileURL, INetProtocol::File );
526 
527  // Be silent...
529  if ( mxEnvironment.is() )
530  {
531  xIH = mxEnvironment->getInteractionHandler();
532  mxEnvironment->setHandler( nullptr );
533  }
534 
535  try
536  {
537  aCnt.executeCommand( "open", aCmdArg );
538  }
539  catch ( InteractiveIOException const & e )
540  {
541  if ( xIH.is() && mxEnvironment.is() )
542  mxEnvironment->setHandler( xIH );
543 
544  if ( e.Code == IOErrorCode_NOT_EXISTING )
545  {
546  // Create file...
547  SvMemoryStream aStream(0,0);
548  ::utl::OInputStreamWrapper* pInput = new ::utl::OInputStreamWrapper( aStream );
549  Reference< XInputStream > xInput( pInput );
550  InsertCommandArgument aInsertArg;
551  aInsertArg.Data = xInput;
552  aInsertArg.ReplaceExisting = false;
553 
554  aCmdArg <<= aInsertArg;
555  aCnt.executeCommand( "insert", aCmdArg );
556 
557  // Retry...
558  return openFileReadWrite( FileURL );
559  }
560 
561  throw;
562  }
563 
564  if ( xIH.is() && mxEnvironment.is() )
565  mxEnvironment->setHandler( xIH );
566 
567  Reference< XStream > xRet = xSink->getStream();
568  return xRet;
569 }
570 
571 void OFileAccess::setInteractionHandler( const Reference< XInteractionHandler >& Handler )
572 {
573  if( !mxEnvironment.is() )
574  {
575  mxEnvironment = new OCommandEnvironment;
576  }
577  mxEnvironment->setHandler( Handler );
578 }
579 
580 bool OFileAccess::createNewFile( const OUString & rParentURL,
581  const OUString & rTitle,
582  const Reference< XInputStream >& data )
583 {
584  ucbhelper::Content aParentCnt( rParentURL, mxEnvironment.get(), comphelper::getProcessComponentContext() );
585 
586  const Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo();
587 
588  for ( const ContentInfo & rCurr : aInfo )
589  {
590  if ( ( rCurr.Attributes
591  & ContentInfoAttribute::KIND_DOCUMENT ) &&
592  ( rCurr.Attributes
593  & ContentInfoAttribute::INSERT_WITH_INPUTSTREAM ) )
594  {
595  // Make sure the only required bootstrap property is
596  // "Title",
597  const Sequence< Property > & rProps = rCurr.Properties;
598  if ( rProps.getLength() != 1 )
599  continue;
600 
601  if ( rProps[ 0 ].Name != "Title" )
602  continue;
603 
604  Sequence<OUString> aNames { "Title" };
605  Sequence< Any > aValues(1);
606  Any* pValues = aValues.getArray();
607  pValues[0] <<= rTitle;
608 
609  try
610  {
611  ucbhelper::Content aNew;
612  if ( aParentCnt.insertNewContent(
613  rCurr.Type, aNames, aValues, data, aNew ) )
614  return true; // success.
615  else
616  continue;
617  }
618  catch ( CommandFailedException const & )
619  {
620  // Interaction Handler already handled the
621  // error that has occurred...
622  continue;
623  }
624  }
625  }
626 
627  return false;
628 }
629 
630 void SAL_CALL OFileAccess::writeFile( const OUString& FileURL,
631  const Reference< XInputStream >& data )
632 {
633  INetURLObject aURL( FileURL, INetProtocol::File );
634  try
635  {
636  ucbhelper::Content aCnt(
637  aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), mxEnvironment.get(),
639 
640  try
641  {
642  aCnt.writeStream( data, true /* bReplaceExisting */ );
643  }
644  catch ( CommandFailedException const & )
645  {
646  // Interaction Handler already handled the error that has occurred...
647  }
648  }
649  catch ( ContentCreationException const & e )
650  {
651  // Most probably file does not exist. Try to create.
652  if ( e.eError == ContentCreationError_CONTENT_CREATION_FAILED )
653  {
654  INetURLObject aParentURLObj( aURL );
655  if ( aParentURLObj.removeSegment() )
656  {
657  OUString aParentURL
659 
660  // ensure all parent folders exist.
661  createFolder( aParentURL );
662 
663  // create the new file...
664  OUString aTitle
666  true,
668  if ( createNewFile( aParentURL, aTitle, data ) )
669  {
670  // success
671  return;
672  }
673  }
674  }
675 
676  throw;
677  }
678 }
679 
680 sal_Bool OFileAccess::isHidden( const OUString& FileURL )
681 {
682  INetURLObject aURLObj( FileURL, INetProtocol::File );
684  Any aRetAny = aCnt.getPropertyValue("IsHidden");
685  bool bRet = false;
686  aRetAny >>= bRet;
687  return bRet;
688 }
689 
690 void OFileAccess::setHidden( const OUString& FileURL, sal_Bool bHidden )
691 {
692  INetURLObject aURLObj( FileURL, INetProtocol::File );
694  aCnt.setPropertyValue("IsHidden", Any(bHidden) );
695 }
696 
697 }; // namespace end
698 
700 {
701  return Reference < XInterface >( static_cast<cppu::OWeakObject *>(new OFileAccess( comphelper::getComponentContext(xSMgr) )) );
702 }
703 
705 {
706  Sequence< OUString > seqNames { SERVICE_NAME };
707  return seqNames;
708 }
709 
710 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Sequence< OUString > FileAccess_getSupportedServiceNames()
Definition: FileAccess.cxx:704
INCLUDE_FOLDERS_AND_DOCUMENTS
#define SERVICE_NAME
Definition: FileAccess.cxx:58
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
css::uno::Any getPropertyValue(const OUString &rPropertyName)
Reference< XInterface > FileAccess_CreateInstance(const Reference< XMultiServiceFactory > &xSMgr)
Definition: FileAccess.cxx:699
OUString getImplementationName()
OUString Name
css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
bool setFinalSlash()
Reference< XInputStream > xStream
Any SAL_CALL getCaughtException()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
unsigned char sal_Bool
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
css::uno::Reference< css::io::XInputStream > openStream()
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
INetProtocol GetProtocol() const
void transferContent(const Content &rSourceContent, InsertOperation eOperation, const OUString &rTitle, const sal_Int32 nNameClashAction, const OUString &rMimeType=OUString(), bool bMajorVersion=false, const OUString &rCommentVersion=OUString(), OUString *pResultURL=nullptr, const OUString &rDocumentId=OUString()) const
void copy(const fs::path &src, const fs::path &dest)
Reference< XComponentContext > getProcessComponentContext()
OString const aName
css::uno::Any setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue)
css::uno::Any executeCommand(const OUString &rCommandName, const css::uno::Any &rCommandArgument)
void writeStream(const css::uno::Reference< css::io::XInputStream > &rStream, bool bReplaceExisting)
INCLUDE_DOCUMENTS_ONLY
const uno::Reference< uno::XComponentContext > m_xContext
#define IMPLEMENTATION_NAME
Definition: FileAccess.hxx:34
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)