mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
merge with default branch
This commit is contained in:
@@ -38,39 +38,27 @@ import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.io.Closeables;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.apache.shiro.codec.Base64;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.config.ScmConfiguration;
|
||||
import sonia.scm.net.Proxies;
|
||||
import sonia.scm.net.TrustAllHostnameVerifier;
|
||||
import sonia.scm.net.TrustAllTrustManager;
|
||||
import sonia.scm.util.HttpUtil;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ProtocolException;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketAddress;
|
||||
import java.net.URL;
|
||||
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.inject.Provider;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.*;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Set;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link AdvancedHttpClient}. The default
|
||||
@@ -324,11 +312,7 @@ public class DefaultAdvancedHttpClient extends AdvancedHttpClient
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
connection.setSSLSocketFactory(sc.getSocketFactory());
|
||||
}
|
||||
catch (KeyManagementException ex)
|
||||
{
|
||||
logger.error("could not disable certificate validation", ex);
|
||||
}
|
||||
catch (NoSuchAlgorithmException ex)
|
||||
catch (KeyManagementException | NoSuchAlgorithmException ex)
|
||||
{
|
||||
logger.error("could not disable certificate validation", ex);
|
||||
}
|
||||
|
||||
@@ -34,20 +34,17 @@ package sonia.scm.net.ahc;
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import com.google.common.io.ByteSource;
|
||||
|
||||
import sonia.scm.plugin.Extension;
|
||||
import sonia.scm.util.IOUtil;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.xml.bind.DataBindingException;
|
||||
import javax.xml.bind.JAXB;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import javax.xml.bind.DataBindingException;
|
||||
import javax.xml.bind.JAXB;
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@link ContentTransformer} for xml. The {@link XmlContentTransformer} uses
|
||||
@@ -96,15 +93,10 @@ public class XmlContentTransformer implements ContentTransformer
|
||||
stream = content.openBufferedStream();
|
||||
object = JAXB.unmarshal(stream, type);
|
||||
}
|
||||
catch (IOException ex)
|
||||
catch (IOException | DataBindingException ex)
|
||||
{
|
||||
throw new ContentTransformerException("could not unmarshall content", ex);
|
||||
}
|
||||
catch (DataBindingException ex)
|
||||
{
|
||||
throw new ContentTransformerException("could not unmarshall content", ex);
|
||||
}
|
||||
finally
|
||||
} finally
|
||||
{
|
||||
IOUtil.close(stream);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class MultiParentClassLoader extends ClassLoader
|
||||
public MultiParentClassLoader(Collection<? extends ClassLoader> parents)
|
||||
{
|
||||
super(null);
|
||||
this.parents = new CopyOnWriteArrayList<ClassLoader>(parents);
|
||||
this.parents = new CopyOnWriteArrayList<>(parents);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
@@ -128,15 +128,7 @@ public class HealthCheckContextListener implements ServletContextListener
|
||||
{
|
||||
|
||||
// excute health checks for all repsitories asynchronous
|
||||
SecurityUtils.getSubject().execute(new Runnable()
|
||||
{
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
healthChecker.checkAll();
|
||||
}
|
||||
});
|
||||
SecurityUtils.getSubject().execute(healthChecker::checkAll);
|
||||
}
|
||||
|
||||
//~--- fields -------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user