[LIB-13] Several options for working through a proxy server
[chesshog-scanner.git] / src / main / java / org / hedgecode / chess / scanner / ScannerConstants.java
1 /*
2  * Copyright (c) 2019-2020. Developed by Hedgecode.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.hedgecode.chess.scanner;
18
19 import java.nio.charset.Charset;
20 import java.nio.charset.StandardCharsets;
21
22 /**
23  * Store of ChessHogScanner constants.
24  *
25  * @author Dmitry Samoshin aka gotty
26  */
27 public final class ScannerConstants {
28
29     public static final Charset CHARSET = StandardCharsets.UTF_8;
30
31     public static final String LOCALE_BUNDLE_FILE = "org.hedgecode.chess.scanner.LocalStrings";
32
33     public static final String CRLF = System.getProperty("line.separator");
34
35     public static final String TYPE_CHESSGAMES = "chessgames";
36     public static final String TYPE_LICHESS = "lichess";
37     public static final String TYPE_CHESSBOMB = "chessbomb";
38     public static final String TYPE_CHESS24 = "chess24";
39     public static final String TYPE_CHESSCOM = "chesscom";
40     public static final String TYPE_2700CHESS = "2700chess";
41
42     public static final String DOMAIN_CHESSGAMES = "chessgames.com";
43     public static final String DOMAIN_LICHESS = "lichess.org";
44     public static final String DOMAIN_CHESSBOMB = "chessbomb.com";
45     public static final String DOMAIN_CHESS24 = "chess24.com";
46     public static final String DOMAIN_CHESSCOM = "chess.com";
47     public static final String DOMAIN_2700CHESS = "2700chess.com";
48
49     public static final String PROXY_UNDEFINED = "undefined";
50     public static final String PROXY_HTTP = "http";
51     public static final String PROXY_HTTPS = "https";
52     public static final String PROXY_SOCKS = "socks";
53     public static final String PROXY_SOCKS_ADDRESS = "socks.address";
54
55     public static final String PROXY_SERVER_REGEX =
56             "^([^:]+):([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}):([0-9]{1,5})$";
57     public static final String PROXY_AUTH_REGEX =
58             "^([^:]+):(.+)$";
59
60
61     private ScannerConstants() {
62         throw new AssertionError(
63                 String.format("No %s instances!", getClass().getName())
64         );
65     }
66
67 }