diff options
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/inc/unotools/ucbhelper.hxx | 5 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 79 |
2 files changed, 0 insertions, 84 deletions
diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx index be94ea41bf4d..b0ed12a57ecc 100644 --- a/unotools/inc/unotools/ucbhelper.hxx +++ b/unotools/inc/unotools/ucbhelper.hxx @@ -47,10 +47,6 @@ namespace utl { class UNOTOOLS_DLLPUBLIC UCBContentHelper { - private: - static sal_Bool Transfer_Impl( const String& rSource, const String& rDest, sal_Bool bMoveData, - sal_Int32 nNameClash ); - public: static sal_Bool IsDocument( const String& rContent ); static sal_Bool IsFolder( const String& rContent ); @@ -72,7 +68,6 @@ namespace utl static sal_Bool IsYounger( const String& rIsYoung, const String& rIsOlder ); static sal_Bool Exists( const String& rContent ); - static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, sal_Bool bAllowWildCards = sal_False ); static sal_Bool IsSubPath( const ::rtl::OUString& rPath, const ::rtl::OUString& rChildCandidate, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >& xContentProvider = ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider >() ); static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); }; diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 5636886558cd..058aa3a90d8f 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -90,55 +90,6 @@ typedef ::std::vector< OUString* > StringList_Impl; namespace utl { -sal_Bool UCBContentHelper::Transfer_Impl( const String& rSource, const String& rDest, sal_Bool bMoveData, sal_Int32 nNameClash ) -{ - sal_Bool bRet = sal_True, bKillSource = sal_False; - INetURLObject aSourceObj( rSource ); - DBG_ASSERT( aSourceObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); - - INetURLObject aDestObj( rDest ); - DBG_ASSERT( aDestObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); - if ( bMoveData && aSourceObj.GetProtocol() != aDestObj.GetProtocol() ) - { - bMoveData = sal_False; - bKillSource = sal_True; - } - String aName = aDestObj.getName(); - aDestObj.removeSegment(); - aDestObj.setFinalSlash(); - - try - { - Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); - uno::Reference< ::com::sun::star::ucb::XCommandInfo > xInfo = aDestPath.getCommands(); - OUString aTransferName(RTL_CONSTASCII_USTRINGPARAM("transfer")); - if ( xInfo->hasCommandByName( aTransferName ) ) - { - aDestPath.executeCommand( aTransferName, makeAny( - ::com::sun::star::ucb::TransferInfo( bMoveData, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, nNameClash ) ) ); - } - else - { - DBG_ERRORFILE( "transfer command not available" ); - } - } - catch( ::com::sun::star::ucb::CommandAbortedException& ) - { - bRet = sal_False; - } - catch( ::com::sun::star::uno::Exception& ) - { - bRet = sal_False; - } - - if ( bKillSource ) - UCBContentHelper::Kill( rSource ); - - return bRet; -} - -// ----------------------------------------------------------------------- - sal_Bool UCBContentHelper::IsDocument( const String& rContent ) { sal_Bool bRet = sal_False; @@ -531,36 +482,6 @@ sal_Bool UCBContentHelper::IsYounger( const String& rIsYoung, const String& rIsO } // ----------------------------------------------------------------------- -sal_Bool UCBContentHelper::Find( const String& rFolder, const String& rName, String& rFile, sal_Bool bAllowWildCards ) -{ - sal_Bool bWild = bAllowWildCards && ( rName.Search( '*' ) != STRING_NOTFOUND || rName.Search( '?' ) != STRING_NOTFOUND ); - - sal_Bool bRet = sal_False; - - // get a list of URLs for all children of rFolder - Sequence< ::rtl::OUString > aFiles = GetFolderContents( rFolder, sal_False ); - - const ::rtl::OUString* pFiles = aFiles.getConstArray(); - sal_uInt32 i, nCount = aFiles.getLength(); - for ( i = 0; i < nCount; ++i ) - { - // get the last name of the URLs and compare it with rName - INetURLObject aFileObject( pFiles[i] ); - String aFile = aFileObject.getName( - INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ).toAsciiLowerCase(); - if ( (bWild && WildCard( rName ).Matches( aFile )) || aFile == rName ) - { - // names match - rFile = aFileObject.GetMainURL( INetURLObject::NO_DECODE ); - bRet = sal_True; - break; - } - } - - return bRet; -} - -// ----------------------------------------------------------------------- sal_Bool UCBContentHelper::Exists( const String& rURL ) { |