aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http/CustomURLStreamHandlerFactory.java
blob: 48bad8f3f3003ded0bffe7ed457c2008acddee00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package de.pixart.messenger.http;

import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;

public class CustomURLStreamHandlerFactory implements URLStreamHandlerFactory {
    @Override
    public URLStreamHandler createURLStreamHandler(String protocol) {
        if (AesGcmURLStreamHandler.PROTOCOL_NAME.equals(protocol)) {
            return new AesGcmURLStreamHandler();
        } else if (P1S3UrlStreamHandler.PROTOCOL_NAME.equals(protocol)) {
            return new P1S3UrlStreamHandler();
        } else {
            return null;
        }
    }
}