@@ -0,0 +1,2830 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one%0A *  or more contributor license agreements.  See the NOTICE file%0A *  distributed with this work for additional information%0A *  regarding copyright ownership.  The ASF licenses this file%0A *  to you under the Apache License, Version 2.0 (the%0A *  %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *        http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A */%0Apackage demoapp.webapp.vaadin.utils;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.http.HttpHost;%0Aimport org.apache.http.auth.AuthScope;%0Aimport org.apache.http.auth.UsernamePasswordCredentials;%0Aimport org.apache.http.client.AuthCache;%0Aimport org.apache.http.client.methods.HttpGet;%0Aimport org.apache.http.client.protocol.HttpClientContext;%0Aimport org.apache.http.impl.auth.BasicScheme;%0Aimport org.apache.http.impl.client.BasicAuthCache;%0Aimport org.apache.http.impl.client.BasicCredentialsProvider;%0Aimport org.apache.http.impl.client.HttpClientBuilder;%0A%0Aimport lombok.val;%0A%0Apublic class ThereCanBeOnlyOne %7B%0A%0A    public static void remoteShutdownOthersIfAny() %7B%0A        try %7B%0A            invokeRemoteShutdown();%0A        %7D catch (Exception e) %7B%0A            // ignore them all%0A        %7D%0A    %7D%0A    %0A    private static void invokeRemoteShutdown() throws IOException %7B%0A        %0A        val targetHost = new HttpHost(%22localhost%22, 8080, %22http%22);%0A        val credsProvider = new BasicCredentialsProvider();%0A        credsProvider.setCredentials(%0A                new AuthScope(targetHost.getHostName(), targetHost.getPort()),%0A                new UsernamePasswordCredentials(%22sven%22, %22pass%22));%0A        %0A        // Create AuthCache instance%0A        AuthCache authCache = new BasicAuthCache();%0A        // Generate BASIC scheme object and add it to the local auth cache%0A        BasicScheme basicAuth = new BasicScheme();%0A        authCache.put(targetHost, basicAuth);%0A%0A        // Add AuthCache to the execution context%0A        HttpClientContext context = HttpClientContext.create();%0A        context.setCredentialsProvider(credsProvider);%0A        context.setAuthCache(authCache);%0A%0A        val httpget = new HttpGet(%22/restful/services/demo.LineBreaker/actions/shutdown/invoke%22);%0A        %0A        try(val httpClient = HttpClientBuilder.create().build())%7B%0A            try(val response = httpClient.execute(targetHost, httpget, context)) %7B%0A                response.getEntity();%0A            %7D %0A        %7D%0A        %0A    %7D%0A    %0A%7D%0A

fix DemoAppVaadin build (2)