"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "solr/core/src/java/org/apache/solr/packagemanager/PackageUtils.java" between
solr-8.4.0-src.tgz and solr-8.4.1-src.tgz

About: Solr is the search platform from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, caching, replication, and a web admin interface.

PackageUtils.java  (solr-8.4.0-src.tgz):PackageUtils.java  (solr-8.4.1-src.tgz)
skipping to change at line 30 skipping to change at line 30
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient; import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.lucene.util.SuppressForbidden; import org.apache.lucene.util.SuppressForbidden;
import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest; import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.request.V2Request; import org.apache.solr.client.solrj.request.V2Request;
import org.apache.solr.client.solrj.response.V2Response; import org.apache.solr.client.solrj.response.V2Response;
import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode; import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.Utils;
import org.apache.solr.core.BlobRepository; import org.apache.solr.core.BlobRepository;
import org.apache.solr.filestore.DistribPackageStore;
import org.apache.solr.filestore.PackageStoreAPI;
import org.apache.solr.packagemanager.SolrPackage.Manifest; import org.apache.solr.packagemanager.SolrPackage.Manifest;
import org.apache.solr.util.SolrJacksonAnnotationInspector; import org.apache.solr.util.SolrJacksonAnnotationInspector;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.zafarkhaja.semver.Version; import com.github.zafarkhaja.semver.Version;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.Configuration;
import com.jayway.jsonpath.spi.json.JacksonJsonProvider; import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
import com.jayway.jsonpath.spi.json.JsonProvider; import com.jayway.jsonpath.spi.json.JsonProvider;
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
skipping to change at line 141 skipping to change at line 145
} }
} }
return null; return null;
} }
/** /**
* Returns JSON string from a given URL * Returns JSON string from a given URL
*/ */
public static String getJsonStringFromUrl(HttpClient client, String url) { public static String getJsonStringFromUrl(HttpClient client, String url) {
try { try {
return IOUtils.toString(client.execute(new HttpGet(url)).getEntity().getCo HttpResponse resp = client.execute(new HttpGet(url));
ntent(), "UTF-8"); if (resp.getStatusLine().getStatusCode() != 200) {
throw new SolrException(ErrorCode.NOT_FOUND,
"Error (code="+resp.getStatusLine().getStatusCode()+") fetching from
URL: "+url);
}
return IOUtils.toString(resp.getEntity().getContent(), "UTF-8");
} catch (UnsupportedOperationException | IOException e) { } catch (UnsupportedOperationException | IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
/** /**
* Checks whether a given version satisfies the constraint (defined by a semve r expression) * Checks whether a given version satisfies the constraint (defined by a semve r expression)
*/ */
public static boolean checkVersionConstraint(String ver, String constraint) { public static boolean checkVersionConstraint(String ver, String constraint) {
return Strings.isNullOrEmpty(constraint) || Version.valueOf(ver).satisfies(c onstraint); return Strings.isNullOrEmpty(constraint) || Version.valueOf(ver).satisfies(c onstraint);
skipping to change at line 260 skipping to change at line 269
for (int i=0; i<params.length; i+=2) { for (int i=0; i<params.length; i+=2) {
Object o = ret.put(params[i], params[i+1]); Object o = ret.put(params[i], params[i+1]);
// TODO: handle multi-valued map? // TODO: handle multi-valued map?
} }
return ret; return ret;
} }
public static String getCollectionParamsPath(String collection) { public static String getCollectionParamsPath(String collection) {
return "/api/collections/" + collection + "/config/params"; return "/api/collections/" + collection + "/config/params";
} }
public static void uploadKey(byte bytes[], String path, Path home, HttpSolrCli
ent client) throws IOException {
ByteBuffer buf = ByteBuffer.wrap(bytes);
PackageStoreAPI.MetaData meta = PackageStoreAPI._createJsonMetaData(buf, nul
l);
DistribPackageStore._persistToFile(home, path, buf, ByteBuffer.wrap(Utils.to
JSON(meta)));
}
} }
 End of changes. 5 change blocks. 
2 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)