LCOV - code coverage report
Current view: top level - svl/source/fsstor - fsstorage.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 149 658 22.6 %
Date: 2012-08-25 Functions: 17 47 36.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 180 1512 11.9 %

           Branch data     Line data    Source code
       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 <com/sun/star/beans/PropertyValue.hpp>
      21                 :            : #include <com/sun/star/embed/ElementModes.hpp>
      22                 :            : #include <com/sun/star/embed/XTransactedObject.hpp>
      23                 :            : #include <com/sun/star/ucb/NameClash.hpp>
      24                 :            : #include <com/sun/star/ucb/XProgressHandler.hpp>
      25                 :            : #include <com/sun/star/ucb/XContentAccess.hpp>
      26                 :            : #include <com/sun/star/ucb/SimpleFileAccess.hpp>
      27                 :            : #include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
      28                 :            : 
      29                 :            : #include <com/sun/star/ucb/InteractiveIOException.hpp>
      30                 :            : #include <com/sun/star/ucb/IOErrorCode.hpp>
      31                 :            : #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
      32                 :            : #include <com/sun/star/container/XEnumerationAccess.hpp>
      33                 :            : #include <com/sun/star/container/XNamed.hpp>
      34                 :            : #include <com/sun/star/util/XChangesBatch.hpp>
      35                 :            : #include <com/sun/star/util/XCloneable.hpp>
      36                 :            : #include <com/sun/star/lang/XUnoTunnel.hpp>
      37                 :            : #include <com/sun/star/lang/XComponent.hpp>
      38                 :            : #include <com/sun/star/lang/DisposedException.hpp>
      39                 :            : #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
      40                 :            : #include <com/sun/star/io/IOException.hpp>
      41                 :            : #include <com/sun/star/io/XTruncate.hpp>
      42                 :            : #include <com/sun/star/sdbc/XResultSet.hpp>
      43                 :            : #include <com/sun/star/sdbc/XRow.hpp>
      44                 :            : 
      45                 :            : 
      46                 :            : #include <comphelper/processfactory.hxx>
      47                 :            : #include <comphelper/componentcontext.hxx>
      48                 :            : #include <comphelper/storagehelper.hxx>
      49                 :            : #include <cppuhelper/typeprovider.hxx>
      50                 :            : #include <cppuhelper/exc_hlp.hxx>
      51                 :            : 
      52                 :            : #include <tools/urlobj.hxx>
      53                 :            : #include <unotools/ucbhelper.hxx>
      54                 :            : #include <unotools/ucbstreamhelper.hxx>
      55                 :            : #include <unotools/streamwrap.hxx>
      56                 :            : #include <ucbhelper/fileidentifierconverter.hxx>
      57                 :            : #include <ucbhelper/contentbroker.hxx>
      58                 :            : #include <ucbhelper/content.hxx>
      59                 :            : 
      60                 :            : #include "fsstorage.hxx"
      61                 :            : #include "oinputstreamcontainer.hxx"
      62                 :            : #include "ostreamcontainer.hxx"
      63                 :            : 
      64                 :            : using namespace ::com::sun::star;
      65                 :            : 
      66                 :            : //=========================================================
      67                 :            : 
      68                 :            : // TODO: move to a standard helper
      69                 :          0 : sal_Bool isLocalFile_Impl( ::rtl::OUString aURL )
      70                 :            : {
      71                 :          0 :     ::rtl::OUString aSystemPath;
      72         [ #  # ]:          0 :     ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
      73         [ #  # ]:          0 :     if ( !pBroker )
      74 [ #  # ][ #  # ]:          0 :         throw uno::RuntimeException();
      75                 :            : 
      76                 :            :     uno::Reference< ucb::XContentProviderManager > xManager =
      77         [ #  # ]:          0 :                 pBroker->getContentProviderManagerInterface();
      78                 :            :     try
      79                 :            :     {
      80         [ #  # ]:          0 :         aSystemPath = ::ucbhelper::getSystemPathFromFileURL( xManager, aURL );
      81                 :            :     }
      82         [ #  # ]:          0 :     catch ( uno::Exception& )
      83                 :            :     {
      84                 :            :     }
      85                 :            : 
      86                 :          0 :     return ( !aSystemPath.isEmpty() );
      87                 :            : }
      88                 :            : 
      89                 :            : 
      90                 :            : //=========================================================
      91                 :            : 
      92                 :            : struct FSStorage_Impl
      93                 :            : {
      94                 :            :     ::rtl::OUString m_aURL;
      95                 :            : 
      96                 :            :     ::ucbhelper::Content* m_pContent;
      97                 :            :     sal_Int32 m_nMode;
      98                 :            : 
      99                 :            :     ::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
     100                 :            :     ::cppu::OTypeCollection* m_pTypeCollection;
     101                 :            : 
     102                 :            :     uno::Reference< lang::XMultiServiceFactory > m_xFactory;
     103                 :            : 
     104                 :            : 
     105                 :            :     FSStorage_Impl( const ::rtl::OUString& aURL, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory )
     106                 :            :     : m_aURL( aURL )
     107                 :            :     , m_pContent( NULL )
     108                 :            :     , m_nMode( nMode )
     109                 :            :     , m_pListenersContainer( NULL )
     110                 :            :     , m_pTypeCollection( NULL )
     111                 :            :     , m_xFactory( xFactory )
     112                 :            :     {
     113                 :            :         OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" );
     114                 :            :     }
     115                 :            : 
     116                 :       2371 :     FSStorage_Impl( const ::ucbhelper::Content& aContent, sal_Int32 nMode, uno::Reference< lang::XMultiServiceFactory > xFactory )
     117                 :       2371 :     : m_aURL( aContent.getURL() )
     118         [ +  - ]:       2371 :     , m_pContent( new ::ucbhelper::Content( aContent ) )
     119                 :            :     , m_nMode( nMode )
     120                 :            :     , m_pListenersContainer( NULL )
     121                 :            :     , m_pTypeCollection( NULL )
     122         [ +  - ]:       4742 :     , m_xFactory( xFactory )
     123                 :            :     {
     124                 :            :         OSL_ENSURE( !m_aURL.isEmpty(), "The URL must not be empty" );
     125                 :       2371 :     }
     126                 :            : 
     127                 :            :     ~FSStorage_Impl();
     128                 :            : };
     129                 :            : 
     130                 :            : //=========================================================
     131                 :            : 
     132                 :       2251 : FSStorage_Impl::~FSStorage_Impl()
     133                 :            : {
     134         [ -  + ]:       2251 :     if ( m_pListenersContainer )
     135 [ #  # ][ #  # ]:          0 :         delete m_pListenersContainer;
     136         [ -  + ]:       2251 :     if ( m_pTypeCollection )
     137 [ #  # ][ #  # ]:          0 :         delete m_pTypeCollection;
     138         [ +  - ]:       2251 :     if ( m_pContent )
     139 [ +  - ][ +  - ]:       2251 :         delete m_pContent;
     140                 :       2251 : }
     141                 :            : 
     142                 :            : //=====================================================
     143                 :            : // FSStorage implementation
     144                 :            : //=====================================================
     145                 :            : 
     146                 :            : //-----------------------------------------------
     147                 :       2371 : FSStorage::FSStorage( const ::ucbhelper::Content& aContent,
     148                 :            :                     sal_Int32 nMode,
     149                 :            :                     uno::Reference< lang::XMultiServiceFactory > xFactory )
     150 [ +  - ][ +  - ]:       2371 : : m_pImpl( new FSStorage_Impl( aContent, nMode, xFactory ) )
                 [ +  - ]
     151                 :            : {
     152                 :            :     // TODO: use properties
     153         [ -  + ]:       2371 :     if ( !xFactory.is() )
     154         [ #  # ]:          0 :         throw uno::RuntimeException();
     155                 :            : 
     156         [ +  - ]:       2371 :     GetContent();
     157                 :       2371 : }
     158                 :            : 
     159                 :            : //-----------------------------------------------
     160 [ +  - ][ +  - ]:       2251 : FSStorage::~FSStorage()
     161                 :            : {
     162                 :            :     {
     163         [ +  - ]:       2251 :         ::osl::MutexGuard aGuard( m_aMutex );
     164                 :       2251 :         m_refCount++; // to call dispose
     165                 :            :         try {
     166         [ +  - ]:       2251 :             dispose();
     167                 :            :         }
     168         [ #  # ]:          0 :         catch( uno::RuntimeException& )
     169         [ +  - ]:       2251 :         {}
     170                 :            :     }
     171 [ -  + ][ #  # ]:       4502 : }
     172                 :            : 
     173                 :            : //-----------------------------------------------
     174                 :        597 : sal_Bool FSStorage::MakeFolderNoUI( const ::rtl::OUString& rFolder )
     175                 :            : {
     176         [ +  - ]:        597 :     INetURLObject aURL( rFolder );
     177         [ +  - ]:        597 :     ::rtl::OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
     178         [ +  - ]:        597 :     aURL.removeSegment();
     179         [ +  - ]:        597 :     ::ucbhelper::Content aParent;
     180         [ +  - ]:        597 :     ::ucbhelper::Content aResultContent;
     181                 :            : 
     182         [ +  - ]:        597 :        if ( ::ucbhelper::Content::create( aURL.GetMainURL( INetURLObject::NO_DECODE ),
     183                 :            :                                  uno::Reference< ucb::XCommandEnvironment >(),
     184 [ +  - ][ +  - ]:        597 :                                  aParent ) )
     185         [ +  - ]:        597 :         return ::utl::UCBContentHelper::MakeFolder( aParent, aTitle, aResultContent, sal_False );
     186                 :            : 
     187 [ +  - ][ +  - ]:        597 :     return sal_False;
                 [ +  - ]
     188                 :            : }
     189                 :            : 
     190                 :            : //-----------------------------------------------
     191                 :      51413 : ::ucbhelper::Content* FSStorage::GetContent()
     192                 :            : {
     193         [ +  - ]:      51413 :     ::osl::MutexGuard aGuard( m_aMutex );
     194         [ -  + ]:      51413 :     if ( !m_pImpl->m_pContent )
     195                 :            :     {
     196                 :          0 :         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     197                 :            : 
     198                 :            :         try
     199                 :            :         {
     200 [ #  # ][ #  # ]:          0 :             m_pImpl->m_pContent = new ::ucbhelper::Content( m_pImpl->m_aURL, xDummyEnv );
                 [ #  # ]
     201                 :            :         }
     202         [ #  # ]:          0 :         catch( uno::Exception& )
     203                 :            :         {
     204                 :          0 :         }
     205                 :            :     }
     206                 :            : 
     207         [ +  - ]:      51413 :     return m_pImpl->m_pContent;
     208                 :            : }
     209                 :            : 
     210                 :            : //-----------------------------------------------
     211                 :          0 : void FSStorage::CopyStreamToSubStream( const ::rtl::OUString& aSourceURL,
     212                 :            :                                         const uno::Reference< embed::XStorage >& xDest,
     213                 :            :                                         const ::rtl::OUString& aNewEntryName )
     214                 :            : {
     215         [ #  # ]:          0 :     if ( !xDest.is() )
     216         [ #  # ]:          0 :         throw uno::RuntimeException();
     217                 :            : 
     218                 :          0 :     uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     219         [ #  # ]:          0 :     ::ucbhelper::Content aSourceContent( aSourceURL, xDummyEnv );
     220         [ #  # ]:          0 :     uno::Reference< io::XInputStream > xSourceInput = aSourceContent.openStream();
     221                 :            : 
     222         [ #  # ]:          0 :     if ( !xSourceInput.is() )
     223         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     224                 :            : 
     225         [ #  # ]:          0 :     uno::Reference< io::XStream > xSubStream = xDest->openStreamElement(
     226                 :            :                                                 aNewEntryName,
     227         [ #  # ]:          0 :                                                 embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
     228         [ #  # ]:          0 :     if ( !xSubStream.is() )
     229         [ #  # ]:          0 :         throw uno::RuntimeException();
     230                 :            : 
     231 [ #  # ][ #  # ]:          0 :     uno::Reference< io::XOutputStream > xDestOutput = xSubStream->getOutputStream();
     232         [ #  # ]:          0 :     if ( !xDestOutput.is() )
     233         [ #  # ]:          0 :         throw uno::RuntimeException();
     234                 :            : 
     235         [ #  # ]:          0 :     ::comphelper::OStorageHelper::CopyInputToOutput( xSourceInput, xDestOutput );
     236 [ #  # ][ #  # ]:          0 :     xDestOutput->closeOutput();
                 [ #  # ]
     237                 :          0 : }
     238                 :            : 
     239                 :            : //-----------------------------------------------
     240                 :          0 : void FSStorage::CopyContentToStorage_Impl( ::ucbhelper::Content* pContent, const uno::Reference< embed::XStorage >& xDest )
     241                 :            : {
     242         [ #  # ]:          0 :     if ( !pContent )
     243         [ #  # ]:          0 :         throw uno::RuntimeException();
     244                 :            : 
     245                 :            :     // get list of contents of the Content
     246                 :            :     // create cursor for access to children
     247         [ #  # ]:          0 :     uno::Sequence< ::rtl::OUString > aProps( 2 );
     248         [ #  # ]:          0 :     ::rtl::OUString* pProps = aProps.getArray();
     249                 :          0 :     pProps[0] = ::rtl::OUString("TargetURL");
     250                 :          0 :     pProps[1] = ::rtl::OUString("IsFolder");
     251                 :          0 :     ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
     252                 :            : 
     253                 :            :     try
     254                 :            :     {
     255         [ #  # ]:          0 :         uno::Reference< sdbc::XResultSet > xResultSet = pContent->createCursor( aProps, eInclude );
     256         [ #  # ]:          0 :         uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
     257         [ #  # ]:          0 :         uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
     258         [ #  # ]:          0 :         if ( xResultSet.is() )
     259                 :            :         {
     260                 :            :             // go through the list: insert files as streams, insert folders as substorages using recursion
     261 [ #  # ][ #  # ]:          0 :             while ( xResultSet->next() )
                 [ #  # ]
     262                 :            :             {
     263 [ #  # ][ #  # ]:          0 :                 ::rtl::OUString aSourceURL( xRow->getString( 1 ) );
     264 [ #  # ][ #  # ]:          0 :                 sal_Bool bIsFolder( xRow->getBoolean(2) );
     265                 :            : 
     266                 :            :                 // TODO/LATER: not sure whether the entry name must be encoded
     267                 :            :                 ::rtl::OUString aNewEntryName( INetURLObject( aSourceURL ).getName( INetURLObject::LAST_SEGMENT,
     268                 :            :                                                                                     true,
     269 [ #  # ][ #  # ]:          0 :                                                                                     INetURLObject::NO_DECODE ) );
                 [ #  # ]
     270         [ #  # ]:          0 :                 if ( bIsFolder )
     271                 :            :                 {
     272         [ #  # ]:          0 :                     uno::Reference< embed::XStorage > xSubStorage = xDest->openStorageElement( aNewEntryName,
     273         [ #  # ]:          0 :                                                                                                 embed::ElementModes::READWRITE );
     274         [ #  # ]:          0 :                     if ( !xSubStorage.is() )
     275         [ #  # ]:          0 :                         throw uno::RuntimeException();
     276                 :            : 
     277                 :          0 :                     uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     278         [ #  # ]:          0 :                     ::ucbhelper::Content aSourceContent( aSourceURL, xDummyEnv );
     279 [ #  # ][ #  # ]:          0 :                     CopyContentToStorage_Impl( &aSourceContent, xSubStorage );
     280                 :            :                 }
     281                 :            :                 else
     282                 :            :                 {
     283         [ #  # ]:          0 :                     CopyStreamToSubStream( aSourceURL, xDest, aNewEntryName );
     284                 :            :                 }
     285                 :          0 :             }
     286                 :            :         }
     287                 :            : 
     288         [ #  # ]:          0 :         uno::Reference< embed::XTransactedObject > xTransact( xDest, uno::UNO_QUERY );
     289         [ #  # ]:          0 :         if ( xTransact.is() )
     290 [ #  # ][ #  # ]:          0 :             xTransact->commit();
     291                 :            :     }
     292   [ #  #  #  # ]:          0 :     catch( ucb::InteractiveIOException& r )
     293                 :            :     {
     294         [ #  # ]:          0 :         if ( r.Code == ucb::IOErrorCode_NOT_EXISTING )
     295                 :            :             OSL_FAIL( "The folder does not exist!\n" );
     296                 :            :         else
     297                 :          0 :             throw;
     298         [ #  # ]:          0 :     }
     299                 :          0 : }
     300                 :            : 
     301                 :            : //____________________________________________________________________________________________________
     302                 :            : //  XInterface
     303                 :            : //____________________________________________________________________________________________________
     304                 :            : 
     305                 :            : //-----------------------------------------------
     306                 :      27031 : uno::Any SAL_CALL FSStorage::queryInterface( const uno::Type& rType )
     307                 :            :         throw( uno::RuntimeException )
     308                 :            : {
     309                 :      27031 :     uno::Any aReturn;
     310                 :            :     aReturn <<= ::cppu::queryInterface
     311                 :            :                 (   rType
     312                 :            :                 ,   static_cast<lang::XTypeProvider*> ( this )
     313                 :            :                 ,   static_cast<embed::XStorage*> ( this )
     314                 :            :                 ,   static_cast<embed::XHierarchicalStorageAccess*> ( this )
     315                 :            :                 ,   static_cast<container::XNameAccess*> ( this )
     316                 :            :                 ,   static_cast<container::XElementAccess*> ( this )
     317                 :            :                 ,   static_cast<lang::XComponent*> ( this )
     318 [ +  - ][ +  - ]:      27031 :                 ,   static_cast<beans::XPropertySet*> ( this ) );
     319                 :            : 
     320         [ +  + ]:      27031 :     if ( aReturn.hasValue() == sal_True )
     321                 :      25300 :         return aReturn ;
     322                 :            : 
     323         [ +  - ]:      27031 :     return OWeakObject::queryInterface( rType );
     324                 :            : }
     325                 :            : 
     326                 :            : //-----------------------------------------------
     327                 :     123316 : void SAL_CALL FSStorage::acquire() throw()
     328                 :            : {
     329                 :     123316 :     OWeakObject::acquire();
     330                 :     123316 : }
     331                 :            : 
     332                 :            : //-----------------------------------------------
     333                 :     123106 : void SAL_CALL FSStorage::release() throw()
     334                 :            : {
     335                 :     123106 :     OWeakObject::release();
     336                 :     123106 : }
     337                 :            : 
     338                 :            : //____________________________________________________________________________________________________
     339                 :            : //  XTypeProvider
     340                 :            : //____________________________________________________________________________________________________
     341                 :            : 
     342                 :            : //-----------------------------------------------
     343                 :          0 : uno::Sequence< uno::Type > SAL_CALL FSStorage::getTypes()
     344                 :            :         throw( uno::RuntimeException )
     345                 :            : {
     346         [ #  # ]:          0 :     if ( m_pImpl->m_pTypeCollection == NULL )
     347                 :            :     {
     348         [ #  # ]:          0 :         ::osl::MutexGuard aGuard( m_aMutex );
     349                 :            : 
     350         [ #  # ]:          0 :         if ( m_pImpl->m_pTypeCollection == NULL )
     351                 :            :         {
     352                 :            :             m_pImpl->m_pTypeCollection = new ::cppu::OTypeCollection
     353                 :            :                                 (   ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL )
     354                 :            :                                 ,   ::getCppuType( ( const uno::Reference< embed::XStorage >* )NULL )
     355                 :            :                                 ,   ::getCppuType( ( const uno::Reference< embed::XHierarchicalStorageAccess >* )NULL )
     356 [ #  # ][ #  # ]:          0 :                                 ,   ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     357         [ #  # ]:          0 :         }
     358                 :            :     }
     359                 :            : 
     360                 :          0 :     return m_pImpl->m_pTypeCollection->getTypes() ;
     361                 :            : }
     362                 :            : 
     363                 :            : //-----------------------------------------------
     364                 :          0 : uno::Sequence< sal_Int8 > SAL_CALL FSStorage::getImplementationId()
     365                 :            :         throw( uno::RuntimeException )
     366                 :            : {
     367                 :            :     static ::cppu::OImplementationId* pID = NULL ;
     368                 :            : 
     369         [ #  # ]:          0 :     if ( pID == NULL )
     370                 :            :     {
     371 [ #  # ][ #  # ]:          0 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ) ;
     372                 :            : 
     373         [ #  # ]:          0 :         if ( pID == NULL )
     374                 :            :         {
     375 [ #  # ][ #  # ]:          0 :             static ::cppu::OImplementationId aID( sal_False ) ;
     376                 :          0 :             pID = &aID ;
     377         [ #  # ]:          0 :         }
     378                 :            :     }
     379                 :            : 
     380                 :          0 :     return pID->getImplementationId() ;
     381                 :            : 
     382                 :            : }
     383                 :            : 
     384                 :            : //____________________________________________________________________________________________________
     385                 :            : //  XStorage
     386                 :            : //____________________________________________________________________________________________________
     387                 :            : 
     388                 :            : //-----------------------------------------------
     389                 :          0 : void SAL_CALL FSStorage::copyToStorage( const uno::Reference< embed::XStorage >& xDest )
     390                 :            :         throw ( embed::InvalidStorageException,
     391                 :            :                 io::IOException,
     392                 :            :                 lang::IllegalArgumentException,
     393                 :            :                 embed::StorageWrappedTargetException,
     394                 :            :                 uno::RuntimeException )
     395                 :            : {
     396         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     397                 :            : 
     398         [ #  # ]:          0 :     if ( !m_pImpl )
     399         [ #  # ]:          0 :         throw lang::DisposedException();
     400                 :            : 
     401 [ #  # ][ #  # ]:          0 :     if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject*> ( this ), uno::UNO_QUERY ) )
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
     402         [ #  # ]:          0 :         throw lang::IllegalArgumentException(); // TODO:
     403                 :            : 
     404 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     405         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     406                 :            : 
     407                 :            :     try
     408                 :            :     {
     409 [ #  # ][ #  # ]:          0 :         CopyContentToStorage_Impl( GetContent(), xDest );
     410                 :            :     }
     411                 :          0 :     catch( embed::InvalidStorageException& )
     412                 :            :     {
     413                 :          0 :         throw;
     414                 :            :     }
     415                 :          0 :     catch( lang::IllegalArgumentException& )
     416                 :            :     {
     417                 :          0 :         throw;
     418                 :            :     }
     419                 :          0 :     catch( embed::StorageWrappedTargetException& )
     420                 :            :     {
     421                 :          0 :         throw;
     422                 :            :     }
     423                 :          0 :     catch( io::IOException& )
     424                 :            :     {
     425                 :          0 :         throw;
     426                 :            :     }
     427                 :          0 :     catch( uno::RuntimeException& )
     428                 :            :     {
     429                 :          0 :         throw;
     430                 :            :     }
     431   [ #  #  #  #  :          0 :     catch( uno::Exception& )
                #  #  # ]
     432                 :            :     {
     433         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
     434                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
     435                 :            :                                                  uno::Reference< io::XInputStream >(),
     436         [ #  # ]:          0 :                                                  aCaught );
     437         [ #  # ]:          0 :     }
     438                 :          0 : }
     439                 :            : 
     440                 :            : //-----------------------------------------------
     441                 :        506 : uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement(
     442                 :            :     const ::rtl::OUString& aStreamName, sal_Int32 nOpenMode )
     443                 :            :         throw ( embed::InvalidStorageException,
     444                 :            :                 lang::IllegalArgumentException,
     445                 :            :                 packages::WrongPasswordException,
     446                 :            :                 io::IOException,
     447                 :            :                 embed::StorageWrappedTargetException,
     448                 :            :                 uno::RuntimeException )
     449                 :            : {
     450         [ +  - ]:        506 :     ::osl::MutexGuard aGuard( m_aMutex );
     451                 :            : 
     452         [ -  + ]:        506 :     if ( !m_pImpl )
     453         [ #  # ]:          0 :         throw lang::DisposedException();
     454                 :            : 
     455 [ +  - ][ -  + ]:        506 :     if ( !GetContent() )
     456         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     457                 :            : 
     458                 :            :     // TODO/LATER: may need possibility to create folder if it was removed, since the folder can not be locked
     459         [ +  - ]:        506 :     INetURLObject aFileURL( m_pImpl->m_aURL );
     460         [ +  - ]:        506 :     aFileURL.Append( aStreamName );
     461                 :            : 
     462 [ +  - ][ +  - ]:        506 :     if ( ::utl::UCBContentHelper::IsFolder( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ -  + ]
     463         [ #  # ]:          0 :         throw io::IOException();
     464                 :            : 
     465 [ -  + ][ #  # ]:       1012 :     if ( ( nOpenMode & embed::ElementModes::NOCREATE )
                 [ -  + ]
     466 [ #  # ][ #  # ]:        506 :       && !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ -  + ][ #  # ]
     467         [ #  # ]:          0 :         throw io::IOException(); // TODO:
     468                 :            : 
     469                 :        506 :     uno::Reference< ucb::XCommandEnvironment > xDummyEnv; // TODO: provide InteractionHandler if any
     470                 :        506 :     uno::Reference< io::XStream > xResult;
     471                 :            :     try
     472                 :            :     {
     473         [ -  + ]:        506 :         if ( nOpenMode & embed::ElementModes::WRITE )
     474                 :            :         {
     475 [ #  # ][ #  # ]:          0 :             if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
     476                 :            :             {
     477                 :            :                 uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess(
     478                 :            :                     ucb::SimpleFileAccess::create(
     479 [ #  # ][ #  # ]:          0 :                         comphelper::ComponentContext(m_pImpl->m_xFactory).getUNOContext() ) );
         [ #  # ][ #  # ]
     480 [ #  # ][ #  # ]:          0 :                 xResult = xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) );
         [ #  # ][ #  # ]
     481                 :            :             }
     482                 :            :             else
     483                 :            :             {
     484                 :            :                 // TODO: test whether it really works for http and fwp
     485                 :            :                 SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ),
     486 [ #  # ][ #  # ]:          0 :                                                                           STREAM_STD_WRITE );
         [ #  # ][ #  # ]
     487         [ #  # ]:          0 :                 if ( pStream )
     488                 :            :                 {
     489         [ #  # ]:          0 :                     if ( !pStream->GetError() )
     490 [ #  # ][ #  # ]:          0 :                         xResult = uno::Reference < io::XStream >( new ::utl::OStreamWrapper( *pStream ) );
         [ #  # ][ #  # ]
     491                 :            :                     else
     492 [ #  # ][ #  # ]:          0 :                         delete pStream;
     493                 :            :                 }
     494                 :            :             }
     495                 :            : 
     496         [ #  # ]:          0 :             if ( !xResult.is() )
     497         [ #  # ]:          0 :                 throw io::IOException();
     498                 :            : 
     499         [ #  # ]:          0 :             if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
     500                 :            :             {
     501 [ #  # ][ #  # ]:          0 :                 uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
                 [ #  # ]
     502 [ #  # ][ #  # ]:          0 :                 xTrunc->truncate();
     503                 :            :             }
     504                 :            :         }
     505                 :            :         else
     506                 :            :         {
     507 [ +  - ][ +  + ]:       1518 :             if ( ( nOpenMode & embed::ElementModes::TRUNCATE )
                 [ +  + ]
     508 [ +  - ][ +  - ]:       1012 :               || !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ +  - ][ #  # ]
     509         [ +  - ]:         94 :                 throw io::IOException(); // TODO: access denied
     510                 :            : 
     511 [ +  - ][ +  - ]:        412 :             ::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
     512         [ +  - ]:        412 :             uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
     513 [ +  - ][ +  - ]:        506 :             xResult = static_cast< io::XStream* >( new OFSInputStreamContainer( xInStream ) );
         [ +  - ][ +  - ]
     514                 :            :         }
     515                 :            :     }
     516                 :          0 :     catch( embed::InvalidStorageException& )
     517                 :            :     {
     518                 :          0 :         throw;
     519                 :            :     }
     520                 :          0 :     catch( lang::IllegalArgumentException& )
     521                 :            :     {
     522                 :          0 :         throw;
     523                 :            :     }
     524                 :          0 :     catch( packages::WrongPasswordException& )
     525                 :            :     {
     526                 :          0 :         throw;
     527                 :            :     }
     528                 :          0 :     catch( embed::StorageWrappedTargetException& )
     529                 :            :     {
     530                 :          0 :         throw;
     531                 :            :     }
     532                 :        188 :     catch( io::IOException& )
     533                 :            :     {
     534                 :         94 :         throw;
     535                 :            :     }
     536                 :          0 :     catch( uno::RuntimeException& )
     537                 :            :     {
     538                 :          0 :         throw;
     539                 :            :     }
     540   [ -  -  -  -  :         94 :     catch( uno::Exception& )
             -  +  -  - ]
     541                 :            :     {
     542         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
     543                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
     544                 :            :                                                  uno::Reference< io::XInputStream >(),
     545         [ #  # ]:          0 :                                                  aCaught );
     546                 :            :     }
     547                 :            : 
     548 [ +  - ][ +  - ]:        506 :     return xResult;
     549                 :            : }
     550                 :            : 
     551                 :            : //-----------------------------------------------
     552                 :          0 : uno::Reference< io::XStream > SAL_CALL FSStorage::openEncryptedStreamElement(
     553                 :            :     const ::rtl::OUString&, sal_Int32, const ::rtl::OUString& )
     554                 :            :         throw ( embed::InvalidStorageException,
     555                 :            :                 lang::IllegalArgumentException,
     556                 :            :                 packages::NoEncryptionException,
     557                 :            :                 packages::WrongPasswordException,
     558                 :            :                 io::IOException,
     559                 :            :                 embed::StorageWrappedTargetException,
     560                 :            :                 uno::RuntimeException )
     561                 :            : {
     562         [ #  # ]:          0 :     throw packages::NoEncryptionException();
     563                 :            : }
     564                 :            : 
     565                 :            : //-----------------------------------------------
     566                 :       2150 : uno::Reference< embed::XStorage > SAL_CALL FSStorage::openStorageElement(
     567                 :            :             const ::rtl::OUString& aStorName, sal_Int32 nStorageMode )
     568                 :            :         throw ( embed::InvalidStorageException,
     569                 :            :                 lang::IllegalArgumentException,
     570                 :            :                 io::IOException,
     571                 :            :                 embed::StorageWrappedTargetException,
     572                 :            :                 uno::RuntimeException )
     573                 :            : {
     574         [ +  - ]:       2150 :     ::osl::MutexGuard aGuard( m_aMutex );
     575                 :            : 
     576         [ -  + ]:       2150 :     if ( !m_pImpl )
     577         [ #  # ]:          0 :         throw lang::DisposedException();
     578                 :            : 
     579 [ +  - ][ -  + ]:       2150 :     if ( !GetContent() )
     580         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     581                 :            : 
     582 [ +  + ][ -  + ]:       2150 :     if ( ( nStorageMode & embed::ElementModes::WRITE )
     583                 :        999 :       && !( m_pImpl->m_nMode & embed::ElementModes::WRITE ) )
     584         [ #  # ]:          0 :           throw io::IOException(); // TODO: error handling
     585                 :            : 
     586                 :            :     // TODO/LATER: may need possibility to create folder if it was removed, since the folder can not be locked
     587         [ +  - ]:       2150 :     INetURLObject aFolderURL( m_pImpl->m_aURL );
     588         [ +  - ]:       2150 :     aFolderURL.Append( aStorName );
     589                 :            : 
     590 [ +  - ][ +  - ]:       2150 :     sal_Bool bFolderExists = ::utl::UCBContentHelper::IsFolder( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ) );
     591 [ +  - ][ +  - ]:       2150 :     if ( !bFolderExists && ::utl::UCBContentHelper::IsDocument( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ -  + ][ +  + ]
           [ -  +  #  # ]
                 [ +  + ]
     592         [ #  # ]:          0 :         throw io::IOException(); // TODO:
     593                 :            : 
     594 [ +  + ][ +  + ]:       2150 :     if ( ( nStorageMode & embed::ElementModes::NOCREATE ) && !bFolderExists )
     595         [ +  - ]:          5 :         throw io::IOException(); // TODO:
     596                 :            : 
     597                 :       2145 :     uno::Reference< ucb::XCommandEnvironment > xDummyEnv; // TODO: provide InteractionHandler if any
     598                 :       2145 :     uno::Reference< embed::XStorage > xResult;
     599                 :            :     try
     600                 :            :     {
     601         [ +  + ]:       2145 :         if ( nStorageMode & embed::ElementModes::WRITE )
     602                 :            :         {
     603 [ -  + ][ #  # ]:        999 :             if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) && bFolderExists )
     604                 :            :             {
     605 [ #  # ][ #  # ]:          0 :                 ::utl::UCBContentHelper::Kill( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ) );
     606                 :            :                 bFolderExists =
     607 [ #  # ][ #  # ]:          0 :                     MakeFolderNoUI( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ) ); // TODO: not atomar :(
     608                 :            :             }
     609         [ +  + ]:        999 :             else if ( !bFolderExists )
     610                 :            :             {
     611                 :            :                 bFolderExists =
     612 [ +  - ][ +  - ]:        999 :                     MakeFolderNoUI( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ) ); // TODO: not atomar :(
     613                 :            :             }
     614                 :            :         }
     615         [ -  + ]:       1146 :         else if ( ( nStorageMode & embed::ElementModes::TRUNCATE ) )
     616         [ #  # ]:          0 :             throw io::IOException(); // TODO: access denied
     617                 :            : 
     618         [ -  + ]:       2145 :         if ( !bFolderExists )
     619         [ #  # ]:          0 :             throw io::IOException(); // there is no such folder
     620                 :            : 
     621 [ +  - ][ +  - ]:       2145 :         ::ucbhelper::Content aResultContent( aFolderURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
     622                 :            :         xResult = uno::Reference< embed::XStorage >(
     623                 :            :                             static_cast< OWeakObject* >( new FSStorage( aResultContent,
     624                 :            :                                                                         nStorageMode,
     625 [ +  - ][ +  - ]:       4290 :                                                                         m_pImpl->m_xFactory ) ),
     626 [ +  - ][ +  - ]:       4290 :                             uno::UNO_QUERY );
                 [ +  - ]
     627                 :            :     }
     628                 :          0 :     catch( embed::InvalidStorageException& )
     629                 :            :     {
     630                 :          0 :         throw;
     631                 :            :     }
     632                 :          0 :     catch( lang::IllegalArgumentException& )
     633                 :            :     {
     634                 :          0 :         throw;
     635                 :            :     }
     636                 :          0 :     catch( embed::StorageWrappedTargetException& )
     637                 :            :     {
     638                 :          0 :         throw;
     639                 :            :     }
     640                 :          0 :     catch( io::IOException& )
     641                 :            :     {
     642                 :          0 :         throw;
     643                 :            :     }
     644                 :          0 :     catch( uno::RuntimeException& )
     645                 :            :     {
     646                 :          0 :         throw;
     647                 :            :     }
     648   [ #  #  #  #  :          0 :     catch( uno::Exception& )
                #  #  # ]
     649                 :            :     {
     650         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
     651                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
     652                 :            :                                                  uno::Reference< io::XInputStream >(),
     653         [ #  # ]:          0 :                                                  aCaught );
     654                 :            :     }
     655                 :            : 
     656 [ +  - ][ +  - ]:       2150 :     return xResult;
     657                 :            : }
     658                 :            : 
     659                 :            : //-----------------------------------------------
     660                 :          0 : uno::Reference< io::XStream > SAL_CALL FSStorage::cloneStreamElement( const ::rtl::OUString& aStreamName )
     661                 :            :         throw ( embed::InvalidStorageException,
     662                 :            :                 lang::IllegalArgumentException,
     663                 :            :                 packages::WrongPasswordException,
     664                 :            :                 io::IOException,
     665                 :            :                 embed::StorageWrappedTargetException,
     666                 :            :                 uno::RuntimeException )
     667                 :            : {
     668         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     669                 :            : 
     670         [ #  # ]:          0 :     if ( !m_pImpl )
     671         [ #  # ]:          0 :         throw lang::DisposedException();
     672                 :            : 
     673 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     674         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     675                 :            : 
     676                 :            :     // TODO/LATER: may need possibility to create folder if it was removed, since the folder can not be locked
     677         [ #  # ]:          0 :     INetURLObject aFileURL( m_pImpl->m_aURL );
     678         [ #  # ]:          0 :     aFileURL.Append( aStreamName );
     679                 :            : 
     680                 :          0 :     uno::Reference < io::XStream > xTempResult;
     681                 :            :     try
     682                 :            :     {
     683                 :          0 :         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     684 [ #  # ][ #  # ]:          0 :         ::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
     685         [ #  # ]:          0 :         uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
     686                 :            : 
     687                 :            :         xTempResult = uno::Reference < io::XStream >(
     688         [ #  # ]:          0 :                     m_pImpl->m_xFactory->createInstance ( ::rtl::OUString("com.sun.star.io.TempFile") ),
     689 [ #  # ][ #  # ]:          0 :                     uno::UNO_QUERY_THROW );
                 [ #  # ]
     690 [ #  # ][ #  # ]:          0 :         uno::Reference < io::XOutputStream > xTempOut = xTempResult->getOutputStream();
     691 [ #  # ][ #  # ]:          0 :         uno::Reference < io::XInputStream > xTempIn = xTempResult->getInputStream();
     692                 :            : 
     693 [ #  # ][ #  # ]:          0 :         if ( !xTempOut.is() || !xTempIn.is() )
                 [ #  # ]
     694         [ #  # ]:          0 :             throw io::IOException();
     695                 :            : 
     696         [ #  # ]:          0 :         ::comphelper::OStorageHelper::CopyInputToOutput( xInStream, xTempOut );
     697 [ #  # ][ #  # ]:          0 :         xTempOut->closeOutput();
                 [ #  # ]
     698                 :            :     }
     699                 :          0 :     catch( embed::InvalidStorageException& )
     700                 :            :     {
     701                 :          0 :         throw;
     702                 :            :     }
     703                 :          0 :     catch( lang::IllegalArgumentException& )
     704                 :            :     {
     705                 :          0 :         throw;
     706                 :            :     }
     707                 :          0 :     catch( packages::WrongPasswordException& )
     708                 :            :     {
     709                 :          0 :         throw;
     710                 :            :     }
     711                 :          0 :     catch( io::IOException& )
     712                 :            :     {
     713                 :          0 :         throw;
     714                 :            :     }
     715                 :          0 :     catch( embed::StorageWrappedTargetException& )
     716                 :            :     {
     717                 :          0 :         throw;
     718                 :            :     }
     719                 :          0 :     catch( uno::RuntimeException& )
     720                 :            :     {
     721                 :          0 :         throw;
     722                 :            :     }
     723   [ #  #  #  #  :          0 :     catch( uno::Exception& )
             #  #  #  # ]
     724                 :            :     {
     725         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
     726                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
     727                 :            :                                                  uno::Reference< io::XInputStream >(),
     728         [ #  # ]:          0 :                                                  aCaught );
     729                 :            :     }
     730                 :            : 
     731 [ #  # ][ #  # ]:          0 :     return xTempResult;
     732                 :            : }
     733                 :            : 
     734                 :            : //-----------------------------------------------
     735                 :          0 : uno::Reference< io::XStream > SAL_CALL FSStorage::cloneEncryptedStreamElement(
     736                 :            :     const ::rtl::OUString&,
     737                 :            :     const ::rtl::OUString& )
     738                 :            :         throw ( embed::InvalidStorageException,
     739                 :            :                 lang::IllegalArgumentException,
     740                 :            :                 packages::NoEncryptionException,
     741                 :            :                 packages::WrongPasswordException,
     742                 :            :                 io::IOException,
     743                 :            :                 embed::StorageWrappedTargetException,
     744                 :            :                 uno::RuntimeException )
     745                 :            : {
     746         [ #  # ]:          0 :     throw packages::NoEncryptionException();
     747                 :            : }
     748                 :            : 
     749                 :            : //-----------------------------------------------
     750                 :          0 : void SAL_CALL FSStorage::copyLastCommitTo(
     751                 :            :             const uno::Reference< embed::XStorage >& xTargetStorage )
     752                 :            :         throw ( embed::InvalidStorageException,
     753                 :            :                 lang::IllegalArgumentException,
     754                 :            :                 io::IOException,
     755                 :            :                 embed::StorageWrappedTargetException,
     756                 :            :                 uno::RuntimeException )
     757                 :            : {
     758                 :          0 :     copyToStorage( xTargetStorage );
     759                 :          0 : }
     760                 :            : 
     761                 :            : //-----------------------------------------------
     762                 :          0 : void SAL_CALL FSStorage::copyStorageElementLastCommitTo(
     763                 :            :             const ::rtl::OUString& aStorName,
     764                 :            :             const uno::Reference< embed::XStorage >& xTargetStorage )
     765                 :            :         throw ( embed::InvalidStorageException,
     766                 :            :                 lang::IllegalArgumentException,
     767                 :            :                 io::IOException,
     768                 :            :                 embed::StorageWrappedTargetException,
     769                 :            :                 uno::RuntimeException )
     770                 :            : {
     771         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     772                 :            : 
     773         [ #  # ]:          0 :     if ( !m_pImpl )
     774         [ #  # ]:          0 :         throw lang::DisposedException();
     775                 :            : 
     776                 :          0 :     uno::Reference< embed::XStorage > xSourceStor( openStorageElement( aStorName, embed::ElementModes::READ ),
     777 [ #  # ][ #  # ]:          0 :                                                     uno::UNO_QUERY_THROW );
     778 [ #  # ][ #  # ]:          0 :     xSourceStor->copyToStorage( xTargetStorage );
                 [ #  # ]
     779                 :          0 : }
     780                 :            : 
     781                 :            : //-----------------------------------------------
     782                 :          0 : sal_Bool SAL_CALL FSStorage::isStreamElement( const ::rtl::OUString& aElementName )
     783                 :            :         throw ( embed::InvalidStorageException,
     784                 :            :                 lang::IllegalArgumentException,
     785                 :            :                 container::NoSuchElementException,
     786                 :            :                 uno::RuntimeException )
     787                 :            : {
     788         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     789                 :            : 
     790         [ #  # ]:          0 :     if ( !m_pImpl )
     791         [ #  # ]:          0 :         throw lang::DisposedException();
     792                 :            : 
     793 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     794         [ #  # ]:          0 :         throw embed::InvalidStorageException(); // TODO: error handling
     795                 :            : 
     796         [ #  # ]:          0 :     INetURLObject aURL( m_pImpl->m_aURL );
     797         [ #  # ]:          0 :     aURL.Append( aElementName );
     798                 :            : 
     799 [ #  # ][ #  # ]:          0 :     return !::utl::UCBContentHelper::IsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
         [ #  # ][ #  # ]
     800                 :            : }
     801                 :            : 
     802                 :            : //-----------------------------------------------
     803                 :          0 : sal_Bool SAL_CALL FSStorage::isStorageElement( const ::rtl::OUString& aElementName )
     804                 :            :         throw ( embed::InvalidStorageException,
     805                 :            :                 lang::IllegalArgumentException,
     806                 :            :                 container::NoSuchElementException,
     807                 :            :                 uno::RuntimeException )
     808                 :            : {
     809         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     810                 :            : 
     811         [ #  # ]:          0 :     if ( !m_pImpl )
     812         [ #  # ]:          0 :         throw lang::DisposedException();
     813                 :            : 
     814 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     815         [ #  # ]:          0 :         throw embed::InvalidStorageException(); // TODO: error handling
     816                 :            : 
     817         [ #  # ]:          0 :     INetURLObject aURL( m_pImpl->m_aURL );
     818         [ #  # ]:          0 :     aURL.Append( aElementName );
     819                 :            : 
     820 [ #  # ][ #  # ]:          0 :     return ::utl::UCBContentHelper::IsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
         [ #  # ][ #  # ]
     821                 :            : }
     822                 :            : 
     823                 :            : //-----------------------------------------------
     824                 :          0 : void SAL_CALL FSStorage::removeElement( const ::rtl::OUString& aElementName )
     825                 :            :         throw ( embed::InvalidStorageException,
     826                 :            :                 lang::IllegalArgumentException,
     827                 :            :                 container::NoSuchElementException,
     828                 :            :                 io::IOException,
     829                 :            :                 embed::StorageWrappedTargetException,
     830                 :            :                 uno::RuntimeException )
     831                 :            : {
     832         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     833                 :            : 
     834         [ #  # ]:          0 :     if ( !m_pImpl )
     835         [ #  # ]:          0 :         throw lang::DisposedException();
     836                 :            : 
     837 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     838         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     839                 :            : 
     840         [ #  # ]:          0 :     INetURLObject aURL( m_pImpl->m_aURL );
     841         [ #  # ]:          0 :     aURL.Append( aElementName );
     842                 :            : 
     843 [ #  # ][ #  # ]:          0 :     if ( !::utl::UCBContentHelper::IsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) )
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
     844 [ #  # ][ #  # ]:          0 :       && !::utl::UCBContentHelper::IsDocument( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ #  # ][ #  # ]
     845         [ #  # ]:          0 :         throw container::NoSuchElementException(); // TODO:
     846                 :            : 
     847 [ #  # ][ #  # ]:          0 :     ::utl::UCBContentHelper::Kill( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
         [ #  # ][ #  # ]
     848                 :          0 : }
     849                 :            : 
     850                 :            : //-----------------------------------------------
     851                 :          0 : void SAL_CALL FSStorage::renameElement( const ::rtl::OUString& aElementName, const ::rtl::OUString& aNewName )
     852                 :            :         throw ( embed::InvalidStorageException,
     853                 :            :                 lang::IllegalArgumentException,
     854                 :            :                 container::NoSuchElementException,
     855                 :            :                 container::ElementExistException,
     856                 :            :                 io::IOException,
     857                 :            :                 embed::StorageWrappedTargetException,
     858                 :            :                 uno::RuntimeException )
     859                 :            : {
     860         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     861                 :            : 
     862         [ #  # ]:          0 :     if ( !m_pImpl )
     863         [ #  # ]:          0 :         throw lang::DisposedException();
     864                 :            : 
     865 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     866         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     867                 :            : 
     868         [ #  # ]:          0 :     INetURLObject aOldURL( m_pImpl->m_aURL );
     869         [ #  # ]:          0 :     aOldURL.Append( aElementName );
     870                 :            : 
     871         [ #  # ]:          0 :     INetURLObject aNewURL( m_pImpl->m_aURL );
     872         [ #  # ]:          0 :     aNewURL.Append( aNewName );
     873                 :            : 
     874 [ #  # ][ #  # ]:          0 :     if ( !::utl::UCBContentHelper::IsFolder( aOldURL.GetMainURL( INetURLObject::NO_DECODE ) )
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
     875 [ #  # ][ #  # ]:          0 :       && !::utl::UCBContentHelper::IsDocument( aOldURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ #  # ][ #  # ]
     876         [ #  # ]:          0 :         throw container::NoSuchElementException(); // TODO:
     877                 :            : 
     878 [ #  # ][ #  # ]:          0 :     if ( ::utl::UCBContentHelper::IsFolder( aNewURL.GetMainURL( INetURLObject::NO_DECODE ) )
         [ #  # ][ #  # ]
                 [ #  # ]
           [ #  #  #  # ]
     879 [ #  # ][ #  # ]:          0 :       || ::utl::UCBContentHelper::IsDocument( aNewURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ #  # ][ #  # ]
     880         [ #  # ]:          0 :           throw container::ElementExistException(); // TODO:
     881                 :            : 
     882                 :            :     try
     883                 :            :     {
     884                 :          0 :         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     885 [ #  # ][ #  # ]:          0 :         ::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
     886                 :            : 
     887         [ #  # ]:          0 :         if ( !GetContent()->transferContent( aSourceContent,
     888                 :            :                                             ::ucbhelper::InsertOperation_MOVE,
     889                 :            :                                             aNewName,
     890 [ #  # ][ #  # ]:          0 :                                             ucb::NameClash::ERROR ) )
     891 [ #  # ][ #  # ]:          0 :             throw io::IOException(); // TODO: error handling
     892                 :            :     }
     893                 :          0 :     catch( embed::InvalidStorageException& )
     894                 :            :     {
     895                 :          0 :         throw;
     896                 :            :     }
     897                 :          0 :     catch( lang::IllegalArgumentException& )
     898                 :            :     {
     899                 :          0 :         throw;
     900                 :            :     }
     901                 :          0 :     catch( container::NoSuchElementException& )
     902                 :            :     {
     903                 :          0 :         throw;
     904                 :            :     }
     905                 :          0 :     catch( container::ElementExistException& )
     906                 :            :     {
     907                 :          0 :         throw;
     908                 :            :     }
     909                 :          0 :     catch( io::IOException& )
     910                 :            :     {
     911                 :          0 :         throw;
     912                 :            :     }
     913                 :          0 :     catch( embed::StorageWrappedTargetException& )
     914                 :            :     {
     915                 :          0 :         throw;
     916                 :            :     }
     917                 :          0 :     catch( uno::RuntimeException& )
     918                 :            :     {
     919                 :          0 :         throw;
     920                 :            :     }
     921   [ #  #  #  #  :          0 :     catch( uno::Exception& )
             #  #  #  #  
                      # ]
     922                 :            :     {
     923         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
     924                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
     925                 :            :                                                  uno::Reference< io::XInputStream >(),
     926         [ #  # ]:          0 :                                                  aCaught );
     927 [ #  # ][ #  # ]:          0 :     }
                 [ #  # ]
     928                 :          0 : }
     929                 :            : 
     930                 :            : //-----------------------------------------------
     931                 :          0 : void SAL_CALL FSStorage::copyElementTo( const ::rtl::OUString& aElementName,
     932                 :            :                                         const uno::Reference< embed::XStorage >& xDest,
     933                 :            :                                         const ::rtl::OUString& aNewName )
     934                 :            :         throw ( embed::InvalidStorageException,
     935                 :            :                 lang::IllegalArgumentException,
     936                 :            :                 container::NoSuchElementException,
     937                 :            :                 container::ElementExistException,
     938                 :            :                 io::IOException,
     939                 :            :                 embed::StorageWrappedTargetException,
     940                 :            :                 uno::RuntimeException )
     941                 :            : {
     942         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
     943                 :            : 
     944         [ #  # ]:          0 :     if ( !m_pImpl )
     945         [ #  # ]:          0 :         throw lang::DisposedException();
     946                 :            : 
     947         [ #  # ]:          0 :     if ( !xDest.is() )
     948         [ #  # ]:          0 :         throw uno::RuntimeException();
     949                 :            : 
     950 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
     951         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
     952                 :            : 
     953         [ #  # ]:          0 :     INetURLObject aOwnURL( m_pImpl->m_aURL );
     954         [ #  # ]:          0 :     aOwnURL.Append( aElementName );
     955                 :            : 
     956 [ #  # ][ #  # ]:          0 :     if ( xDest->hasByName( aNewName ) )
                 [ #  # ]
     957         [ #  # ]:          0 :           throw container::ElementExistException(); // TODO:
     958                 :            : 
     959                 :            :     try
     960                 :            :     {
     961                 :          0 :         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
     962 [ #  # ][ #  # ]:          0 :         if ( ::utl::UCBContentHelper::IsFolder( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
     963                 :            :         {
     964 [ #  # ][ #  # ]:          0 :             ::ucbhelper::Content aSourceContent( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
     965                 :            :             uno::Reference< embed::XStorage > xDestSubStor(
     966         [ #  # ]:          0 :                                     xDest->openStorageElement( aNewName, embed::ElementModes::READWRITE ),
     967 [ #  # ][ #  # ]:          0 :                                     uno::UNO_QUERY_THROW );
     968                 :            : 
     969 [ #  # ][ #  # ]:          0 :             CopyContentToStorage_Impl( &aSourceContent, xDestSubStor );
     970                 :            :         }
     971 [ #  # ][ #  # ]:          0 :         else if ( ::utl::UCBContentHelper::IsDocument( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
     972                 :            :         {
     973 [ #  # ][ #  # ]:          0 :             CopyStreamToSubStream( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ), xDest, aNewName );
     974                 :            :         }
     975                 :            :         else
     976         [ #  # ]:          0 :             throw container::NoSuchElementException(); // TODO:
     977                 :            :     }
     978                 :          0 :     catch( embed::InvalidStorageException& )
     979                 :            :     {
     980                 :          0 :         throw;
     981                 :            :     }
     982                 :          0 :     catch( lang::IllegalArgumentException& )
     983                 :            :     {
     984                 :          0 :         throw;
     985                 :            :     }
     986                 :          0 :     catch( container::NoSuchElementException& )
     987                 :            :     {
     988                 :          0 :         throw;
     989                 :            :     }
     990                 :          0 :     catch( container::ElementExistException& )
     991                 :            :     {
     992                 :          0 :         throw;
     993                 :            :     }
     994                 :          0 :     catch( embed::StorageWrappedTargetException& )
     995                 :            :     {
     996                 :          0 :         throw;
     997                 :            :     }
     998                 :          0 :     catch( io::IOException& )
     999                 :            :     {
    1000                 :          0 :         throw;
    1001                 :            :     }
    1002                 :          0 :     catch( uno::RuntimeException& )
    1003                 :            :     {
    1004                 :          0 :         throw;
    1005                 :            :     }
    1006   [ #  #  #  #  :          0 :     catch( uno::Exception& )
             #  #  #  #  
                      # ]
    1007                 :            :     {
    1008         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
    1009                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
    1010                 :            :                                                  uno::Reference< io::XInputStream >(),
    1011         [ #  # ]:          0 :                                                  aCaught );
    1012 [ #  # ][ #  # ]:          0 :     }
    1013                 :          0 : }
    1014                 :            : 
    1015                 :            : //-----------------------------------------------
    1016                 :          0 : void SAL_CALL FSStorage::moveElementTo( const ::rtl::OUString& aElementName,
    1017                 :            :                                         const uno::Reference< embed::XStorage >& xDest,
    1018                 :            :                                         const ::rtl::OUString& aNewName )
    1019                 :            :         throw ( embed::InvalidStorageException,
    1020                 :            :                 lang::IllegalArgumentException,
    1021                 :            :                 container::NoSuchElementException,
    1022                 :            :                 container::ElementExistException,
    1023                 :            :                 io::IOException,
    1024                 :            :                 embed::StorageWrappedTargetException,
    1025                 :            :                 uno::RuntimeException )
    1026                 :            : {
    1027         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1028         [ #  # ]:          0 :     copyElementTo( aElementName, xDest, aNewName );
    1029                 :            : 
    1030         [ #  # ]:          0 :     INetURLObject aOwnURL( m_pImpl->m_aURL );
    1031         [ #  # ]:          0 :     aOwnURL.Append( aElementName );
    1032 [ #  # ][ #  # ]:          0 :     if ( !::utl::UCBContentHelper::Kill( aOwnURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1033 [ #  # ][ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
                 [ #  # ]
    1034                 :          0 : }
    1035                 :            : 
    1036                 :            : //____________________________________________________________________________________________________
    1037                 :            : //  XNameAccess
    1038                 :            : //____________________________________________________________________________________________________
    1039                 :            : 
    1040                 :            : //-----------------------------------------------
    1041                 :        442 : uno::Any SAL_CALL FSStorage::getByName( const ::rtl::OUString& aName )
    1042                 :            :         throw ( container::NoSuchElementException,
    1043                 :            :                 lang::WrappedTargetException,
    1044                 :            :                 uno::RuntimeException )
    1045                 :            : {
    1046         [ +  - ]:        442 :     ::osl::MutexGuard aGuard( m_aMutex );
    1047                 :            : 
    1048         [ -  + ]:        442 :     if ( !m_pImpl )
    1049         [ #  # ]:          0 :         throw lang::DisposedException();
    1050                 :            : 
    1051 [ +  - ][ -  + ]:        442 :     if ( !GetContent() )
    1052         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
    1053                 :            : 
    1054         [ -  + ]:        442 :     if ( aName.isEmpty() )
    1055         [ #  # ]:          0 :         throw lang::IllegalArgumentException();
    1056                 :            : 
    1057         [ +  - ]:        442 :     INetURLObject aURL( m_pImpl->m_aURL );
    1058         [ +  - ]:        442 :     aURL.Append( aName );
    1059                 :            : 
    1060                 :        442 :     uno::Any aResult;
    1061                 :            :     try
    1062                 :            :     {
    1063 [ +  - ][ +  - ]:        442 :         if ( ::utl::UCBContentHelper::IsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ +  - ]
    1064                 :            :         {
    1065 [ +  - ][ +  - ]:        442 :             aResult <<= openStorageElement( aName, embed::ElementModes::READ );
    1066                 :            :         }
    1067 [ #  # ][ #  # ]:          0 :         else if ( ::utl::UCBContentHelper::IsDocument( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1068                 :            :         {
    1069 [ #  # ][ #  # ]:          0 :             aResult <<= openStreamElement( aName, embed::ElementModes::READ );
    1070                 :            :         }
    1071                 :            :         else
    1072         [ #  # ]:          0 :             throw container::NoSuchElementException(); // TODO:
    1073                 :            :     }
    1074                 :          0 :     catch( container::NoSuchElementException& )
    1075                 :            :     {
    1076                 :          0 :         throw;
    1077                 :            :     }
    1078                 :          0 :     catch( lang::WrappedTargetException& )
    1079                 :            :     {
    1080                 :          0 :         throw;
    1081                 :            :     }
    1082                 :          0 :     catch( uno::RuntimeException& )
    1083                 :            :     {
    1084                 :          0 :         throw;
    1085                 :            :     }
    1086   [ #  #  #  #  :          0 :     catch ( uno::Exception& )
                      # ]
    1087                 :            :     {
    1088         [ #  # ]:          0 :            uno::Any aCaught( ::cppu::getCaughtException() );
    1089                 :            :         throw lang::WrappedTargetException( ::rtl::OUString("Can not open element!\n"),
    1090                 :            :                                             uno::Reference< uno::XInterface >(  static_cast< OWeakObject* >( this ),
    1091                 :            :                                                                                 uno::UNO_QUERY ),
    1092   [ #  #  #  # ]:          0 :                                             aCaught );
    1093                 :            :     }
    1094                 :            : 
    1095 [ +  - ][ +  - ]:        442 :     return aResult;
    1096                 :            : }
    1097                 :            : 
    1098                 :            : 
    1099                 :            : //-----------------------------------------------
    1100                 :      22451 : uno::Sequence< ::rtl::OUString > SAL_CALL FSStorage::getElementNames()
    1101                 :            :         throw ( uno::RuntimeException )
    1102                 :            : {
    1103         [ +  - ]:      22451 :     ::osl::MutexGuard aGuard( m_aMutex );
    1104                 :            : 
    1105         [ -  + ]:      22451 :     if ( !m_pImpl )
    1106         [ #  # ]:          0 :         throw lang::DisposedException();
    1107                 :            : 
    1108 [ +  - ][ -  + ]:      22451 :     if ( !GetContent() )
    1109         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
    1110                 :            : 
    1111         [ +  - ]:      22451 :     uno::Sequence< ::rtl::OUString > aProps( 1 );
    1112         [ +  - ]:      22451 :     ::rtl::OUString* pProps = aProps.getArray();
    1113                 :      22451 :     pProps[0] = ::rtl::OUString("Title");
    1114                 :      22451 :     ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
    1115                 :            : 
    1116         [ +  - ]:      22451 :     uno::Sequence< ::rtl::OUString > aResult;
    1117                 :      22451 :     sal_Int32 nSize = 0;
    1118                 :            : 
    1119                 :            :     try
    1120                 :            :     {
    1121 [ +  - ][ +  - ]:      22451 :         uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, eInclude );
    1122         [ +  - ]:      22451 :         uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
    1123         [ +  - ]:      22451 :         uno::Reference< sdbc::XRow > xRow( xResultSet, uno::UNO_QUERY );
    1124         [ +  - ]:      22451 :         if ( xResultSet.is() )
    1125                 :            :         {
    1126                 :            :             // go through the list
    1127 [ +  - ][ +  - ]:      29483 :             while ( xResultSet->next() )
                 [ +  + ]
    1128                 :            :             {
    1129 [ +  - ][ +  - ]:       7032 :                 ::rtl::OUString aName( xRow->getString( 1 ) );
    1130         [ +  - ]:       7032 :                 aResult.realloc( ++nSize );
    1131         [ +  - ]:       7032 :                 aResult[nSize-1] = aName;
    1132                 :       7032 :             }
    1133                 :      22451 :         }
    1134                 :            :     }
    1135         [ #  # ]:          0 :     catch( const ucb::InteractiveIOException& r )
    1136                 :            :     {
    1137         [ #  # ]:          0 :         if ( r.Code == ucb::IOErrorCode_NOT_EXISTING )
    1138                 :            :             OSL_FAIL( "The folder does not exist!\n" );
    1139                 :            :         else
    1140                 :            :         {
    1141         [ #  # ]:          0 :                uno::Any aCaught( ::cppu::getCaughtException() );
    1142                 :            :             throw lang::WrappedTargetRuntimeException( ::rtl::OUString("Can not open storage!\n"),
    1143                 :            :                                             uno::Reference< uno::XInterface >(  static_cast< OWeakObject* >( this ),
    1144                 :            :                                                                                 uno::UNO_QUERY ),
    1145   [ #  #  #  # ]:          0 :                                             aCaught );
    1146                 :            :         }
    1147                 :            :     }
    1148                 :          0 :     catch( uno::RuntimeException& )
    1149                 :            :     {
    1150                 :          0 :         throw;
    1151                 :            :     }
    1152   [ #  #  #  # ]:          0 :     catch ( uno::Exception& )
    1153                 :            :     {
    1154         [ #  # ]:          0 :            uno::Any aCaught( ::cppu::getCaughtException() );
    1155                 :            :         throw lang::WrappedTargetRuntimeException( ::rtl::OUString("Can not open storage!\n"),
    1156                 :            :                                             uno::Reference< uno::XInterface >(  static_cast< OWeakObject* >( this ),
    1157                 :            :                                                                                 uno::UNO_QUERY ),
    1158   [ #  #  #  # ]:          0 :                                             aCaught );
    1159                 :            :     }
    1160                 :            : 
    1161 [ +  - ][ +  - ]:      22451 :     return aResult;
    1162                 :            : }
    1163                 :            : 
    1164                 :            : 
    1165                 :            : //-----------------------------------------------
    1166                 :       1042 : sal_Bool SAL_CALL FSStorage::hasByName( const ::rtl::OUString& aName )
    1167                 :            :         throw ( uno::RuntimeException )
    1168                 :            : {
    1169         [ +  - ]:       1042 :     ::osl::MutexGuard aGuard( m_aMutex );
    1170                 :            : 
    1171         [ -  + ]:       1042 :     if ( !m_pImpl )
    1172         [ #  # ]:          0 :         throw lang::DisposedException();
    1173                 :            : 
    1174                 :            :     try
    1175                 :            :     {
    1176 [ +  - ][ -  + ]:       1042 :         if ( !GetContent() )
    1177         [ #  # ]:          0 :             throw io::IOException(); // TODO: error handling
    1178                 :            : 
    1179         [ -  + ]:       1042 :         if ( aName.isEmpty() )
    1180         [ #  # ]:          0 :             throw lang::IllegalArgumentException();
    1181                 :            :     }
    1182                 :          0 :     catch( uno::RuntimeException& )
    1183                 :            :     {
    1184                 :          0 :         throw;
    1185                 :            :     }
    1186      [ #  #  # ]:          0 :     catch ( uno::Exception& )
    1187                 :            :     {
    1188         [ #  # ]:          0 :            uno::Any aCaught( ::cppu::getCaughtException() );
    1189                 :            :         throw lang::WrappedTargetRuntimeException( ::rtl::OUString("Can not open storage!\n"),
    1190                 :            :                                             uno::Reference< uno::XInterface >(  static_cast< OWeakObject* >( this ),
    1191                 :            :                                                                                 uno::UNO_QUERY ),
    1192   [ #  #  #  # ]:          0 :                                             aCaught );
    1193                 :            :     }
    1194                 :            : 
    1195         [ +  - ]:       1042 :     INetURLObject aURL( m_pImpl->m_aURL );
    1196         [ +  - ]:       1042 :     aURL.Append( aName );
    1197                 :            : 
    1198 [ +  - ][ +  - ]:       2084 :     return ( ::utl::UCBContentHelper::IsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) )
         [ +  - ][ #  # ]
    1199 [ +  + ][ +  - ]:       2084 :       || ::utl::UCBContentHelper::IsDocument( aURL.GetMainURL( INetURLObject::NO_DECODE ) ) );
         [ +  - ][ +  + ]
         [ +  + ][ +  - ]
         [ +  - ][ #  # ]
    1200                 :            : }
    1201                 :            : 
    1202                 :            : //-----------------------------------------------
    1203                 :          0 : uno::Type SAL_CALL FSStorage::getElementType()
    1204                 :            :         throw ( uno::RuntimeException )
    1205                 :            : {
    1206         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1207                 :            : 
    1208         [ #  # ]:          0 :     if ( !m_pImpl )
    1209         [ #  # ]:          0 :         throw lang::DisposedException();
    1210                 :            : 
    1211                 :            :     // it is a multitype container
    1212         [ #  # ]:          0 :     return uno::Type();
    1213                 :            : }
    1214                 :            : 
    1215                 :            : //-----------------------------------------------
    1216                 :          0 : sal_Bool SAL_CALL FSStorage::hasElements()
    1217                 :            :         throw ( uno::RuntimeException )
    1218                 :            : {
    1219         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1220                 :            : 
    1221         [ #  # ]:          0 :     if ( !m_pImpl )
    1222         [ #  # ]:          0 :         throw lang::DisposedException();
    1223                 :            : 
    1224 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
    1225         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
    1226                 :            : 
    1227         [ #  # ]:          0 :     uno::Sequence< ::rtl::OUString > aProps( 1 );
    1228         [ #  # ]:          0 :     aProps[0] = ::rtl::OUString("TargetURL");
    1229                 :          0 :     ::ucbhelper::ResultSetInclude eInclude = ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS;
    1230                 :            : 
    1231                 :            :     try
    1232                 :            :     {
    1233 [ #  # ][ #  # ]:          0 :         uno::Reference< sdbc::XResultSet > xResultSet = GetContent()->createCursor( aProps, eInclude );
    1234 [ #  # ][ #  # ]:          0 :         return ( xResultSet.is() && xResultSet->next() );
         [ #  # ][ #  # ]
    1235                 :            :     }
    1236         [ #  # ]:          0 :     catch( uno::Exception& )
    1237                 :            :     {
    1238         [ #  # ]:          0 :         throw uno::RuntimeException();
    1239 [ #  # ][ #  # ]:          0 :     }
    1240                 :            : }
    1241                 :            : 
    1242                 :            : 
    1243                 :            : //____________________________________________________________________________________________________
    1244                 :            : //  XDisposable
    1245                 :            : //____________________________________________________________________________________________________
    1246                 :            : 
    1247                 :            : //-----------------------------------------------
    1248                 :       2251 : void SAL_CALL FSStorage::dispose()
    1249                 :            :         throw ( uno::RuntimeException )
    1250                 :            : {
    1251         [ +  - ]:       2251 :     ::osl::MutexGuard aGuard( m_aMutex );
    1252                 :            : 
    1253         [ -  + ]:       2251 :     if ( !m_pImpl )
    1254         [ #  # ]:          0 :         throw lang::DisposedException();
    1255                 :            : 
    1256         [ -  + ]:       2251 :     if ( m_pImpl->m_pListenersContainer )
    1257                 :            :     {
    1258 [ #  # ][ #  # ]:          0 :            lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
    1259 [ #  # ][ #  # ]:          0 :         m_pImpl->m_pListenersContainer->disposeAndClear( aSource );
    1260                 :            :     }
    1261                 :            : 
    1262 [ +  - ][ +  - ]:       2251 :     delete m_pImpl;
    1263         [ +  - ]:       2251 :     m_pImpl = NULL;
    1264                 :       2251 : }
    1265                 :            : 
    1266                 :            : //-----------------------------------------------
    1267                 :          0 : void SAL_CALL FSStorage::addEventListener(
    1268                 :            :             const uno::Reference< lang::XEventListener >& xListener )
    1269                 :            :         throw ( uno::RuntimeException )
    1270                 :            : {
    1271         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1272                 :            : 
    1273         [ #  # ]:          0 :     if ( !m_pImpl )
    1274         [ #  # ]:          0 :         throw lang::DisposedException();
    1275                 :            : 
    1276         [ #  # ]:          0 :     if ( !m_pImpl->m_pListenersContainer )
    1277         [ #  # ]:          0 :         m_pImpl->m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutex );
    1278                 :            : 
    1279 [ #  # ][ #  # ]:          0 :     m_pImpl->m_pListenersContainer->addInterface( xListener );
    1280                 :          0 : }
    1281                 :            : 
    1282                 :            : //-----------------------------------------------
    1283                 :          0 : void SAL_CALL FSStorage::removeEventListener(
    1284                 :            :             const uno::Reference< lang::XEventListener >& xListener )
    1285                 :            :         throw ( uno::RuntimeException )
    1286                 :            : {
    1287         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1288                 :            : 
    1289         [ #  # ]:          0 :     if ( !m_pImpl )
    1290         [ #  # ]:          0 :         throw lang::DisposedException();
    1291                 :            : 
    1292         [ #  # ]:          0 :     if ( m_pImpl->m_pListenersContainer )
    1293 [ #  # ][ #  # ]:          0 :         m_pImpl->m_pListenersContainer->removeInterface( xListener );
    1294                 :          0 : }
    1295                 :            : 
    1296                 :            : //____________________________________________________________________________________________________
    1297                 :            : //  XPropertySet
    1298                 :            : //____________________________________________________________________________________________________
    1299                 :            : 
    1300                 :            : //-----------------------------------------------
    1301                 :          0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL FSStorage::getPropertySetInfo()
    1302                 :            :         throw ( uno::RuntimeException )
    1303                 :            : {
    1304         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1305                 :            : 
    1306         [ #  # ]:          0 :     if ( !m_pImpl )
    1307         [ #  # ]:          0 :         throw lang::DisposedException();
    1308                 :            : 
    1309                 :            :     //TODO:
    1310         [ #  # ]:          0 :     return uno::Reference< beans::XPropertySetInfo >();
    1311                 :            : }
    1312                 :            : 
    1313                 :            : 
    1314                 :            : //-----------------------------------------------
    1315                 :          0 : void SAL_CALL FSStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& )
    1316                 :            :         throw ( beans::UnknownPropertyException,
    1317                 :            :                 beans::PropertyVetoException,
    1318                 :            :                 lang::IllegalArgumentException,
    1319                 :            :                 lang::WrappedTargetException,
    1320                 :            :                 uno::RuntimeException )
    1321                 :            : {
    1322         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1323                 :            : 
    1324         [ #  # ]:          0 :     if ( !m_pImpl )
    1325         [ #  # ]:          0 :         throw lang::DisposedException();
    1326                 :            : 
    1327 [ #  # ][ #  # ]:          0 :     if ( aPropertyName == "URL" || aPropertyName == "OpenMode" )
                 [ #  # ]
    1328         [ #  # ]:          0 :         throw beans::PropertyVetoException(); // TODO
    1329                 :            :     else
    1330         [ #  # ]:          0 :         throw beans::UnknownPropertyException(); // TODO
    1331                 :            : }
    1332                 :            : 
    1333                 :            : 
    1334                 :            : //-----------------------------------------------
    1335                 :        294 : uno::Any SAL_CALL FSStorage::getPropertyValue( const ::rtl::OUString& aPropertyName )
    1336                 :            :         throw ( beans::UnknownPropertyException,
    1337                 :            :                 lang::WrappedTargetException,
    1338                 :            :                 uno::RuntimeException )
    1339                 :            : {
    1340         [ +  - ]:        294 :     ::osl::MutexGuard aGuard( m_aMutex );
    1341                 :            : 
    1342         [ -  + ]:        294 :     if ( !m_pImpl )
    1343         [ #  # ]:          0 :         throw lang::DisposedException();
    1344                 :            : 
    1345         [ -  + ]:        294 :     if ( aPropertyName == "URL" )
    1346         [ #  # ]:          0 :         return uno::makeAny( m_pImpl->m_aURL );
    1347         [ +  - ]:        294 :     else if ( aPropertyName == "OpenMode" )
    1348         [ +  - ]:        294 :         return uno::makeAny( m_pImpl->m_nMode );
    1349                 :            : 
    1350 [ #  # ][ +  - ]:        294 :     throw beans::UnknownPropertyException(); // TODO
    1351                 :            : }
    1352                 :            : 
    1353                 :            : 
    1354                 :            : //-----------------------------------------------
    1355                 :          0 : void SAL_CALL FSStorage::addPropertyChangeListener(
    1356                 :            :             const ::rtl::OUString& /*aPropertyName*/,
    1357                 :            :             const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
    1358                 :            :         throw ( beans::UnknownPropertyException,
    1359                 :            :                 lang::WrappedTargetException,
    1360                 :            :                 uno::RuntimeException )
    1361                 :            : {
    1362         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1363                 :            : 
    1364         [ #  # ]:          0 :     if ( !m_pImpl )
    1365 [ #  # ][ #  # ]:          0 :         throw lang::DisposedException();
    1366                 :            : 
    1367                 :            :     //TODO:
    1368                 :          0 : }
    1369                 :            : 
    1370                 :            : 
    1371                 :            : //-----------------------------------------------
    1372                 :          0 : void SAL_CALL FSStorage::removePropertyChangeListener(
    1373                 :            :             const ::rtl::OUString& /*aPropertyName*/,
    1374                 :            :             const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
    1375                 :            :         throw ( beans::UnknownPropertyException,
    1376                 :            :                 lang::WrappedTargetException,
    1377                 :            :                 uno::RuntimeException )
    1378                 :            : {
    1379         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1380                 :            : 
    1381         [ #  # ]:          0 :     if ( !m_pImpl )
    1382 [ #  # ][ #  # ]:          0 :         throw lang::DisposedException();
    1383                 :            : 
    1384                 :            :     //TODO:
    1385                 :          0 : }
    1386                 :            : 
    1387                 :            : 
    1388                 :            : //-----------------------------------------------
    1389                 :          0 : void SAL_CALL FSStorage::addVetoableChangeListener(
    1390                 :            :             const ::rtl::OUString& /*PropertyName*/,
    1391                 :            :             const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
    1392                 :            :         throw ( beans::UnknownPropertyException,
    1393                 :            :                 lang::WrappedTargetException,
    1394                 :            :                 uno::RuntimeException )
    1395                 :            : {
    1396         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1397                 :            : 
    1398         [ #  # ]:          0 :     if ( !m_pImpl )
    1399 [ #  # ][ #  # ]:          0 :         throw lang::DisposedException();
    1400                 :            : 
    1401                 :            :     //TODO:
    1402                 :          0 : }
    1403                 :            : 
    1404                 :            : 
    1405                 :            : //-----------------------------------------------
    1406                 :          0 : void SAL_CALL FSStorage::removeVetoableChangeListener(
    1407                 :            :             const ::rtl::OUString& /*PropertyName*/,
    1408                 :            :             const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
    1409                 :            :         throw ( beans::UnknownPropertyException,
    1410                 :            :                 lang::WrappedTargetException,
    1411                 :            :                 uno::RuntimeException )
    1412                 :            : {
    1413         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1414                 :            : 
    1415         [ #  # ]:          0 :     if ( !m_pImpl )
    1416 [ #  # ][ #  # ]:          0 :         throw lang::DisposedException();
    1417                 :            : 
    1418                 :            :     //TODO:
    1419                 :          0 : }
    1420                 :            : 
    1421                 :            : //____________________________________________________________________________________________________
    1422                 :            : //  XHierarchicalStorageAccess
    1423                 :            : //____________________________________________________________________________________________________
    1424                 :            : //-----------------------------------------------
    1425                 :          0 : uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath, ::sal_Int32 nOpenMode )
    1426                 :            :         throw ( embed::InvalidStorageException,
    1427                 :            :                 lang::IllegalArgumentException,
    1428                 :            :                 packages::WrongPasswordException,
    1429                 :            :                 io::IOException,
    1430                 :            :                 embed::StorageWrappedTargetException,
    1431                 :            :                 uno::RuntimeException )
    1432                 :            : {
    1433         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1434                 :            : 
    1435         [ #  # ]:          0 :     if ( !m_pImpl )
    1436         [ #  # ]:          0 :         throw lang::DisposedException();
    1437                 :            : 
    1438         [ #  # ]:          0 :     if ( sStreamPath.toChar() == '/' )
    1439         [ #  # ]:          0 :         throw lang::IllegalArgumentException();
    1440                 :            : 
    1441 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
    1442         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
    1443                 :            : 
    1444         [ #  # ]:          0 :     INetURLObject aBaseURL( m_pImpl->m_aURL );
    1445 [ #  # ][ #  # ]:          0 :     if ( !aBaseURL.setFinalSlash() )
    1446         [ #  # ]:          0 :         throw uno::RuntimeException();
    1447                 :            : 
    1448                 :            :     INetURLObject aFileURL = INetURLObject::GetAbsURL(
    1449                 :            :                 aBaseURL.GetMainURL( INetURLObject::NO_DECODE ),
    1450 [ #  # ][ #  # ]:          0 :                 sStreamPath );
                 [ #  # ]
    1451                 :            : 
    1452 [ #  # ][ #  # ]:          0 :     if ( ::utl::UCBContentHelper::IsFolder( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1453         [ #  # ]:          0 :         throw io::IOException();
    1454                 :            : 
    1455 [ #  # ][ #  # ]:          0 :     if ( ( nOpenMode & embed::ElementModes::NOCREATE )
                 [ #  # ]
    1456 [ #  # ][ #  # ]:          0 :       && !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ #  # ][ #  # ]
    1457         [ #  # ]:          0 :         throw io::IOException(); // TODO:
    1458                 :            : 
    1459                 :          0 :     uno::Reference< ucb::XCommandEnvironment > xDummyEnv; // TODO: provide InteractionHandler if any
    1460                 :          0 :     uno::Reference< io::XStream > xResult;
    1461                 :            :     try
    1462                 :            :     {
    1463         [ #  # ]:          0 :         if ( nOpenMode & embed::ElementModes::WRITE )
    1464                 :            :         {
    1465 [ #  # ][ #  # ]:          0 :             if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1466                 :            :             {
    1467                 :            :                 uno::Reference<ucb::XSimpleFileAccess2> xSimpleFileAccess(
    1468                 :            :                     ucb::SimpleFileAccess::create(
    1469 [ #  # ][ #  # ]:          0 :                         comphelper::ComponentContext(m_pImpl->m_xFactory).getUNOContext() ) );
         [ #  # ][ #  # ]
    1470                 :            :                 uno::Reference< io::XStream > xStream =
    1471 [ #  # ][ #  # ]:          0 :                     xSimpleFileAccess->openFileReadWrite( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) );
                 [ #  # ]
    1472                 :            : 
    1473 [ #  # ][ #  # ]:          0 :                 xResult = static_cast< io::XStream* >( new OFSStreamContainer( xStream ) );
                 [ #  # ]
    1474                 :            :             }
    1475                 :            :             else
    1476                 :            :             {
    1477                 :            :                 // TODO: test whether it really works for http and fwp
    1478                 :            :                 SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aFileURL.GetMainURL( INetURLObject::NO_DECODE ),
    1479 [ #  # ][ #  # ]:          0 :                                                                           STREAM_STD_WRITE );
         [ #  # ][ #  # ]
    1480         [ #  # ]:          0 :                 if ( pStream )
    1481                 :            :                 {
    1482         [ #  # ]:          0 :                     if ( !pStream->GetError() )
    1483                 :            :                     {
    1484                 :            :                         uno::Reference< io::XStream > xStream =
    1485 [ #  # ][ #  # ]:          0 :                             uno::Reference < io::XStream >( new ::utl::OStreamWrapper( *pStream ) );
                 [ #  # ]
    1486 [ #  # ][ #  # ]:          0 :                         xResult = static_cast< io::XStream* >( new OFSStreamContainer( xStream ) );
                 [ #  # ]
    1487                 :            :                     }
    1488                 :            :                     else
    1489 [ #  # ][ #  # ]:          0 :                         delete pStream;
    1490                 :            :                 }
    1491                 :            :             }
    1492                 :            : 
    1493         [ #  # ]:          0 :             if ( !xResult.is() )
    1494         [ #  # ]:          0 :                 throw io::IOException();
    1495                 :            : 
    1496         [ #  # ]:          0 :             if ( ( nOpenMode & embed::ElementModes::TRUNCATE ) )
    1497                 :            :             {
    1498 [ #  # ][ #  # ]:          0 :                 uno::Reference< io::XTruncate > xTrunc( xResult->getOutputStream(), uno::UNO_QUERY_THROW );
                 [ #  # ]
    1499 [ #  # ][ #  # ]:          0 :                 xTrunc->truncate();
    1500                 :            :             }
    1501                 :            :         }
    1502                 :            :         else
    1503                 :            :         {
    1504 [ #  # ][ #  # ]:          0 :             if ( ( nOpenMode & embed::ElementModes::TRUNCATE )
                 [ #  # ]
    1505 [ #  # ][ #  # ]:          0 :               || !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
         [ #  # ][ #  # ]
    1506         [ #  # ]:          0 :                 throw io::IOException(); // TODO: access denied
    1507                 :            : 
    1508 [ #  # ][ #  # ]:          0 :             ::ucbhelper::Content aResultContent( aFileURL.GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv );
    1509         [ #  # ]:          0 :             uno::Reference< io::XInputStream > xInStream = aResultContent.openStream();
    1510 [ #  # ][ #  # ]:          0 :             xResult = static_cast< io::XStream* >( new OFSInputStreamContainer( xInStream ) );
         [ #  # ][ #  # ]
    1511                 :            :         }
    1512                 :            :     }
    1513                 :          0 :     catch( embed::InvalidStorageException& )
    1514                 :            :     {
    1515                 :          0 :         throw;
    1516                 :            :     }
    1517                 :          0 :     catch( lang::IllegalArgumentException& )
    1518                 :            :     {
    1519                 :          0 :         throw;
    1520                 :            :     }
    1521                 :          0 :     catch( packages::WrongPasswordException& )
    1522                 :            :     {
    1523                 :          0 :         throw;
    1524                 :            :     }
    1525                 :          0 :     catch( embed::StorageWrappedTargetException& )
    1526                 :            :     {
    1527                 :          0 :         throw;
    1528                 :            :     }
    1529                 :          0 :     catch( io::IOException& )
    1530                 :            :     {
    1531                 :          0 :         throw;
    1532                 :            :     }
    1533                 :          0 :     catch( uno::RuntimeException& )
    1534                 :            :     {
    1535                 :          0 :         throw;
    1536                 :            :     }
    1537   [ #  #  #  #  :          0 :     catch( uno::Exception& )
             #  #  #  # ]
    1538                 :            :     {
    1539         [ #  # ]:          0 :           uno::Any aCaught( ::cppu::getCaughtException() );
    1540                 :            :         throw embed::StorageWrappedTargetException( ::rtl::OUString("Can't copy raw stream"),
    1541                 :            :                                                  uno::Reference< io::XInputStream >(),
    1542         [ #  # ]:          0 :                                                  aCaught );
    1543                 :            :     }
    1544                 :            : 
    1545 [ #  # ][ #  # ]:          0 :     return uno::Reference< embed::XExtendedStorageStream >( xResult, uno::UNO_QUERY_THROW );
         [ #  # ][ #  # ]
    1546                 :            : }
    1547                 :            : 
    1548                 :            : //-----------------------------------------------
    1549                 :          0 : uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openEncryptedStreamElementByHierarchicalName( const ::rtl::OUString& /*sStreamName*/, ::sal_Int32 /*nOpenMode*/, const ::rtl::OUString& /*sPassword*/ )
    1550                 :            :         throw ( embed::InvalidStorageException,
    1551                 :            :                 lang::IllegalArgumentException,
    1552                 :            :                 packages::NoEncryptionException,
    1553                 :            :                 packages::WrongPasswordException,
    1554                 :            :                 io::IOException,
    1555                 :            :                 embed::StorageWrappedTargetException,
    1556                 :            :                 uno::RuntimeException )
    1557                 :            : {
    1558         [ #  # ]:          0 :     throw packages::NoEncryptionException();
    1559                 :            : }
    1560                 :            : 
    1561                 :            : //-----------------------------------------------
    1562                 :          0 : void SAL_CALL FSStorage::removeStreamElementByHierarchicalName( const ::rtl::OUString& sStreamPath )
    1563                 :            :         throw ( embed::InvalidStorageException,
    1564                 :            :                 lang::IllegalArgumentException,
    1565                 :            :                 container::NoSuchElementException,
    1566                 :            :                 io::IOException,
    1567                 :            :                 embed::StorageWrappedTargetException,
    1568                 :            :                 uno::RuntimeException )
    1569                 :            : {
    1570         [ #  # ]:          0 :     ::osl::MutexGuard aGuard( m_aMutex );
    1571                 :            : 
    1572         [ #  # ]:          0 :     if ( !m_pImpl )
    1573         [ #  # ]:          0 :         throw lang::DisposedException();
    1574                 :            : 
    1575 [ #  # ][ #  # ]:          0 :     if ( !GetContent() )
    1576         [ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
    1577                 :            : 
    1578                 :            :     // TODO/LATER: may need possibility to create folder if it was removed, since the folder can not be locked
    1579         [ #  # ]:          0 :     INetURLObject aBaseURL( m_pImpl->m_aURL );
    1580 [ #  # ][ #  # ]:          0 :     if ( !aBaseURL.setFinalSlash() )
    1581         [ #  # ]:          0 :         throw uno::RuntimeException();
    1582                 :            : 
    1583                 :            :     INetURLObject aFileURL = INetURLObject::GetAbsURL(
    1584                 :            :                 aBaseURL.GetMainURL( INetURLObject::NO_DECODE ),
    1585 [ #  # ][ #  # ]:          0 :                 sStreamPath );
                 [ #  # ]
    1586                 :            : 
    1587 [ #  # ][ #  # ]:          0 :     if ( !::utl::UCBContentHelper::IsDocument( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1588                 :            :     {
    1589 [ #  # ][ #  # ]:          0 :         if ( ::utl::UCBContentHelper::IsFolder( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1590         [ #  # ]:          0 :             throw lang::IllegalArgumentException();
    1591                 :            :         else
    1592         [ #  # ]:          0 :             throw container::NoSuchElementException(); // TODO:
    1593                 :            :     }
    1594                 :            : 
    1595 [ #  # ][ #  # ]:          0 :     if ( !::utl::UCBContentHelper::Kill( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) )
                 [ #  # ]
    1596 [ #  # ][ #  # ]:          0 :         throw io::IOException(); // TODO: error handling
         [ #  # ][ #  # ]
    1597                 :          0 : }
    1598                 :            : 
    1599                 :            : 
    1600                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10