1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #include "unotools/unotoolsdllapi.h" 24 25 #ifndef _UNOTOOLS_UCBHELPER_HXX 26 #define _UNOTOOLS_UCBHELPER_HXX 27 28 // include --------------------------------------------------------------- 29 #include <com/sun/star/uno/Sequence.hxx> 30 #include <com/sun/star/uno/Reference.hxx> 31 #include <com/sun/star/ucb/NameClash.hpp> 32 #include <com/sun/star/ucb/XContentProvider.hpp> 33 34 #include <tools/string.hxx> 35 36 namespace ucbhelper 37 { 38 class Content; 39 } 40 41 namespace utl 42 { 43 class UNOTOOLS_DLLPUBLIC UCBContentHelper 44 { 45 private: 46 static sal_Bool Transfer_Impl( const String& rSource, const String& rDest, sal_Bool bMoveData, 47 sal_Int32 nNameClash ); 48 49 public: 50 static sal_Bool IsDocument( const String& rContent ); 51 static sal_Bool IsFolder( const String& rContent ); 52 static sal_Bool GetTitle( const String& rContent, String& rTitle ); 53 static sal_Bool Kill( const String& rContent ); 54 55 static ::com::sun::star::uno::Any GetProperty( const String& rURL, const ::rtl::OUString& rName ); 56 57 static ::com::sun::star::uno::Sequence< ::rtl::OUString > 58 GetFolderContents( const String& rFolder, sal_Bool bFolder, sal_Bool bSorted = sal_False ); 59 static ::com::sun::star::uno::Sequence< ::rtl::OUString > GetResultSet( const String& rURL ); 60 61 static sal_Bool CopyTo( const String& rSource, const String& rDest ); 62 static sal_Bool MoveTo( const String& rSource, const String& rDest, sal_Int32 nNameClash = com::sun::star::ucb::NameClash::ERROR ); 63 64 static sal_Bool CanMakeFolder( const String& rFolder ); 65 static sal_Bool MakeFolder( const String& rFolder, sal_Bool bNewOnly = sal_False ); 66 static sal_Bool MakeFolder( ::ucbhelper::Content& rParent, 67 const String& rTitle, 68 ::ucbhelper::Content& rNewFolder, 69 sal_Bool bNewOnly = sal_False ); 70 static sal_Bool HasParentFolder( const String& rFolder ); 71 72 static sal_uLong GetSize( const String& rContent ); 73 static sal_Bool IsYounger( const String& rIsYoung, const String& rIsOlder ); 74 75 static sal_Bool Exists( const String& rContent ); 76 static sal_Bool FindInPath( const String& rPath, const String& rName, String& rFile, char cDelim = ';', sal_Bool bAllowWildCards = sal_True ); 77 static sal_Bool Find( const String& rFolder, const String& rName, String& rFile, sal_Bool bAllowWildCards = sal_False ); 78 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 >() ); 79 static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); 80 }; 81 } 82 83 #endif 84 85 86