cleanup common package

This commit is contained in:
Jörg Prante 2021-04-09 13:31:34 +02:00
parent 96eabdd32d
commit 21e5dd84c9
7 changed files with 1 additions and 51 deletions

View file

@ -1,25 +0,0 @@
package org.xbib.elx.common.io;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
public class ClasspathURLStreamHandler extends URLStreamHandler {
private final ClassLoader classLoader;
public ClasspathURLStreamHandler() {
this.classLoader = getClass().getClassLoader();
}
public ClasspathURLStreamHandler(ClassLoader classLoader) {
this.classLoader = classLoader;
}
@Override
protected URLConnection openConnection(URL u) throws IOException {
final URL resourceUrl = classLoader.getResource(u.getPath());
return resourceUrl != null ? resourceUrl.openConnection() : null;
}
}

View file

@ -1,12 +0,0 @@
package org.xbib.elx.common.io;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
public class ClasspathURLStreamHandlerFactory implements URLStreamHandlerFactory {
@Override
public URLStreamHandler createURLStreamHandler(String protocol) {
return "classpath".equals(protocol) ? new ClasspathURLStreamHandler() : null;
}
}

View file

@ -1,4 +0,0 @@
/**
* I/O helpers for Elasticsearch client extensions.
*/
package org.xbib.elx.common.io;

View file

@ -1,4 +0,0 @@
/**
* Utilities for Elasticsearch client extensions.
*/
package org.xbib.elx.common.util;

View file

@ -1 +0,0 @@
org.xbib.elx.common.io.ClasspathURLStreamHandlerFactory

View file

@ -1,4 +1,4 @@
package org.xbib.elx.common.util;
package org.xbib.elx.transport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -16,9 +16,6 @@ import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
/**
*
*/
public class NetworkUtils {
private static final Logger logger = LogManager.getLogger(NetworkUtils.class.getName());

View file

@ -24,7 +24,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.transport.Netty4Plugin;
import org.xbib.elx.common.util.NetworkUtils;
import java.io.IOException;
import java.net.InetAddress;