1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <cppuhelper/bootstrap.hxx>
23 #include "updateprotocol.hxx"
24 #include <com/sun/star/ucb/UniversalContentBroker.hpp>
27 #include <osl/process.h>
29 #include "sal/log.hxx"
31 namespace task
= ::com::sun::star::task
;
32 namespace uno
= ::com::sun::star::uno
;
40 if( osl_getCommandArgCount() != 0 )
42 fprintf(stderr
, "Usage: updateprotocoltest\n");
46 // create the initial component context
47 uno::Reference
< uno::XComponentContext
> rComponentContext
= cppu::defaultBootstrap_InitialComponentContext();
49 // initialize UCB (for backwards compatibility, in case some code still uses
50 // plain createInstance w/o args directly to obtain an instance):
51 css::ucb::UniversalContentBroker::create(rComponentContext
);
59 if( checkForUpdates(rComponentContext
, uno::Reference
< task::XInteractionHandler
> (), aURL
, aVersion
) )
61 SAL_INFO("extensions.update", "Update found: " << aVersion
<< " on " << aURL
);
65 SAL_INFO("extensions.update", "no updates found" );
70 SAL_INFO("extensions.update", "unhandled exception caught" );
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */