Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (C) FuseSource, Inc.
* http://fusesource.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fusesource.fabric.agent;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.felix.bundlerepository.Property;
import org.apache.felix.bundlerepository.Reason;
import org.apache.felix.bundlerepository.Repository;
import org.apache.felix.bundlerepository.RepositoryAdmin;
import org.apache.felix.bundlerepository.Requirement;
import org.apache.felix.bundlerepository.Resource;
import org.apache.felix.bundlerepository.impl.ResourceImpl;
import org.apache.karaf.features.BundleInfo;
import org.apache.karaf.features.Feature;
import org.fusesource.fabric.fab.DependencyTree;
import org.fusesource.fabric.fab.osgi.FabBundleInfo;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ObrResolver {
private static final Logger LOGGER = LoggerFactory.getLogger(ObrResolver.class);
private RepositoryAdmin repositoryAdmin;
private boolean resolveOptionalImports;
public ObrResolver() {
}
public ObrResolver(RepositoryAdmin repositoryAdmin) {
this.repositoryAdmin = repositoryAdmin;
}
public RepositoryAdmin getRepositoryAdmin() {
return repositoryAdmin;
}
public void setRepositoryAdmin(RepositoryAdmin repositoryAdmin) {
this.repositoryAdmin = repositoryAdmin;
}
public boolean isResolveOptionalImports() {
return resolveOptionalImports;
}
/**
* When set to true, the OBR resolver will try to resolve optional imports as well.
* Defaults to false
*
* @param resolveOptionalImports
*/
public void setResolveOptionalImports(boolean resolveOptionalImports) {
this.resolveOptionalImports = resolveOptionalImports;
}
public List resolve(Set features,
Set bundles,
Map fabs,
Set overrides,
Map downloads) throws Exception {
List reqs = new ArrayList();
List ress = new ArrayList();
List deploy = new ArrayList();
Map