@@ -0,0 +1,2725 @@
+/*%0A * Licensed to Elastic Search and Shay Banon under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership. Elastic Search licenses this%0A * file 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 */%0A%0Apackage org.elasticsearch.cloud.blobstore;%0A%0Aimport org.elasticsearch.ElasticSearchException;%0Aimport org.elasticsearch.util.component.AbstractLifecycleComponent;%0Aimport org.elasticsearch.util.guice.inject.Inject;%0Aimport org.elasticsearch.util.settings.Settings;%0Aimport org.jclouds.blobstore.BlobStoreContext;%0Aimport org.jclouds.blobstore.BlobStoreContextFactory;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * @author kimchy (shay.banon)%0A */%0Apublic class CloudBlobStoreService extends AbstractLifecycleComponent%3CCloudBlobStoreService%3E %7B%0A%0A    private final String type;%0A%0A    private final BlobStoreContext blobStoreContext;%0A%0A    @Inject public CloudBlobStoreService(Settings settings) throws IOException %7B%0A        super(settings);%0A%0A        String type = componentSettings.get(%22type%22);%0A        if (type == null) %7B%0A            // see if we can get a global type%0A            type = settings.get(%22cloud.type%22);%0A        %7D%0A        // consolidate names%0A        if (%22aws%22.equalsIgnoreCase(type) %7C%7C %22amazon%22.equalsIgnoreCase(type)) %7B%0A            type = %22s3%22;%0A        %7D else if (%22rackspace%22.equalsIgnoreCase(type)) %7B%0A            type = %22cloudfiles%22;%0A        %7D%0A        this.type = type;%0A%0A        String account = componentSettings.get(%22account%22, settings.get(%22cloud.account%22));%0A        String key = componentSettings.get(%22key%22, settings.get(%22cloud.key%22));%0A%0A        if (type != null) %7B%0A            blobStoreContext = new BlobStoreContextFactory().createContext(type, account, key);%0A            logger.info(%22Connected to %5B%7B%7D%5D blob store service%22);%0A        %7D else %7B%0A            blobStoreContext = null;%0A        %7D%0A    %7D%0A%0A    @Override protected void doStart() throws ElasticSearchException %7B%0A    %7D%0A%0A    @Override protected void doStop() throws ElasticSearchException %7B%0A    %7D%0A%0A    @Override protected void doClose() throws ElasticSearchException %7B%0A        if (blobStoreContext != null) %7B%0A            blobStoreContext.close();%0A        %7D%0A    %7D%0A%7D%0A

rename hell