27 #include <osl/mutex.hxx>
28 #include <com/sun/star/ucb/IllegalIdentifierException.hpp>
40 const uno::Reference< uno::XComponentContext >& rContext )
41 : ::
ucbhelper::ContentProviderImplHelper( rContext ),
56 OWeakObject::acquire();
62 OWeakObject::release();
68 static_cast< lang::XTypeProvider* >(
this),
69 static_cast< lang::XServiceInfo* >(
this),
70 static_cast< ucb::XContentProvider* >(
this)
72 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
81 ucb::XContentProvider );
87 return getImplementationName_Static();
90 OUString ContentProvider::getImplementationName_Static()
92 return "com.sun.star.comp.WebDAVContentProvider";
102 return getSupportedServiceNames_Static();
106 static css::uno::Reference< css::uno::XInterface >
109 css::lang::XServiceInfo* pX =
111 return css::uno::Reference< css::uno::XInterface >::query( pX );
114 css::uno::Sequence< OUString >
115 ContentProvider::getSupportedServiceNames_Static()
123 css::uno::Reference< css::lang::XSingleServiceFactory >
124 ContentProvider::createServiceFactory(
const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
128 ContentProvider::getImplementationName_Static(),
130 ContentProvider::getSupportedServiceNames_Static() );
139 uno::Reference< ucb::XContent > SAL_CALL
141 const uno::Reference<
142 ucb::XContentIdentifier >& Identifier )
147 if (
aURL.isSchemeEqualTo(INetProtocol::NotValid))
148 throw ucb::IllegalIdentifierException();
150 if (!
aURL.isAnyKnownWebDAVScheme())
151 throw ucb::IllegalIdentifierException();
153 uno::Reference< ucb::XContentIdentifier > xCanonicId;
155 if (
aURL.isSchemeEqualTo(INetProtocol::VndSunStarWebdav) ||
159 aURL.changeScheme(INetProtocol::Http);
160 xCanonicId = new ::ucbhelper::ContentIdentifier(
aURL.getExternalURL() );
166 aURL.changeScheme(INetProtocol::Https);
167 xCanonicId = new ::ucbhelper::ContentIdentifier(
aURL.getExternalURL() );
177 uno::Reference< ucb::XContent >
xContent
186 xContent = new ::http_dav_ucp::Content(
190 catch ( ucb::ContentCreationException
const & )
192 throw ucb::IllegalIdentifierException();
195 if ( !xContent->getIdentifier().is() )
196 throw ucb::IllegalIdentifierException();
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
#define WEBDAV_CONTENT_PROVIDER_SERVICE_NAME
#define WEBDAV_URL_SCHEME
XTYPEPROVIDER_IMPL_3(ContentProvider, lang::XTypeProvider, lang::XServiceInfo, ucb::XContentProvider)
#define WEBDAVS_URL_SCHEME
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual ~ContentProvider() override
virtual void SAL_CALL acquire() override
static css::uno::Reference< css::uno::XInterface > ContentProvider_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr)
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
virtual void SAL_CALL release() override
rtl::Reference< ContentImplHelper > queryExistingContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier)
#define VNDSUNSTARWEBDAVS_URL_SCHEME
css::uno::Reference< css::uno::XComponentContext > m_xContext
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
void registerNewContent(const css::uno::Reference< css::ucb::XContent > &xContent)
Reference< XSingleServiceFactory > SAL_CALL createOneInstanceFactory(const Reference< XMultiServiceFactory > &rServiceManager, const OUString &rImplementationName, ComponentInstantiation pCreateFunction, const Sequence< OUString > &rServiceNames, rtl_ModuleCount *)
virtual OUString SAL_CALL getImplementationName() override
rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
uno::Reference< ucb::XContent > xContent
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override