2017-02-07 18:31:54 +00:00
|
|
|
package eu.siacs.conversations.http;
|
|
|
|
|
2017-02-07 18:32:12 +00:00
|
|
|
import java.net.URLStreamHandler;
|
|
|
|
import java.net.URLStreamHandlerFactory;
|
|
|
|
|
2018-05-25 10:24:23 +00:00
|
|
|
public class CustomURLStreamHandlerFactory implements URLStreamHandlerFactory {
|
|
|
|
|
2017-02-07 18:32:12 +00:00
|
|
|
@Override
|
|
|
|
public URLStreamHandler createURLStreamHandler(String protocol) {
|
2017-02-07 19:07:57 +00:00
|
|
|
if (AesGcmURLStreamHandler.PROTOCOL_NAME.equals(protocol)) {
|
|
|
|
return new AesGcmURLStreamHandler();
|
2018-05-25 10:24:23 +00:00
|
|
|
} else if (P1S3UrlStreamHandler.PROTOCOL_NAME.equals(protocol)) {
|
|
|
|
return new P1S3UrlStreamHandler();
|
2017-02-07 18:32:12 +00:00
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2017-02-07 18:31:54 +00:00
|
|
|
}
|