cleanup common package
This commit is contained in:
parent
96eabdd32d
commit
21e5dd84c9
7 changed files with 1 additions and 51 deletions
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
/**
|
|
||||||
* I/O helpers for Elasticsearch client extensions.
|
|
||||||
*/
|
|
||||||
package org.xbib.elx.common.io;
|
|
|
@ -1,4 +0,0 @@
|
||||||
/**
|
|
||||||
* Utilities for Elasticsearch client extensions.
|
|
||||||
*/
|
|
||||||
package org.xbib.elx.common.util;
|
|
|
@ -1 +0,0 @@
|
||||||
org.xbib.elx.common.io.ClasspathURLStreamHandlerFactory
|
|
|
@ -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.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
@ -16,9 +16,6 @@ import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class NetworkUtils {
|
public class NetworkUtils {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(NetworkUtils.class.getName());
|
private static final Logger logger = LogManager.getLogger(NetworkUtils.class.getName());
|
|
@ -24,7 +24,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||||
import org.elasticsearch.plugins.Plugin;
|
import org.elasticsearch.plugins.Plugin;
|
||||||
import org.elasticsearch.transport.Netty4Plugin;
|
import org.elasticsearch.transport.Netty4Plugin;
|
||||||
import org.xbib.elx.common.util.NetworkUtils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
|
Loading…
Reference in a new issue