CategoryJava

How to use a JNLP file

H

This weekend, someone asked me for help with a specific file. He has an Audi and wanted to upgrade his GPS maps. But all he has was an 8 KB downloader file with a JNLP extension. When opening the file, he gets an error that says that the extension is not recognized. First, I’ll give you Oracles explanation of JNLP: Java Network Launch Protocol (JNLP) enables an application to be launched on...

How to create a stream from an iterator in java 8

H

Hi guys! In this post I’ll show you how to convert a java iterator to a java 8 stream. The code is really simple: public static <T> Stream<T> iteratorToStream(final Iterator<T> iterator, final boolean parallell) { Iterable<T> iterable = () -> iterator; return StreamSupport.stream(iterable.spliterator(), parallell); } Just copy paste this static method in any class you like...

How to fix Unirest General SSLEngine problem

H

I tried to post data to a rest service using Unirest (unirest.io). But when I tried to post to an HTTPS url, I got the following error: javax.net.ssl.SSLHandshakeException: General SSLEngine problem PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.provider.certpath...

How to enable CORS in Solr

H

If you are using Solr with Angular or something like that. The browser can be annoying about cross site scripting. To enable CORS in Solr you just have to add the code below in solr-x.x.x/server/solr-webapp/webapp/WEB-INF/web.xml (x.x.x stands for the solr version). Just after the <web-app> tag.

Tag Cloud

Categories