aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLStreamHandlerFactory.java
blob: 15defa5ed8d8191cf37d32da8636ec39898e516d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package kr.syeyoung.dungeonsguide.customurl;

import kr.syeyoung.dungeonsguide.Authenticator;

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

public class DGURLStreamHandlerFactory implements URLStreamHandlerFactory {
    private Authenticator authenticator;
    public DGURLStreamHandlerFactory(Authenticator authenticator) {
        this.authenticator = authenticator;
    }
    @Override
    public URLStreamHandler createURLStreamHandler(String s) {
        if ("dungeonsguide".equals(s)) {
            return new DGURLStreamHandler(authenticator);
        }

        return null;
    }
}