blob: f93c965b21c27a15d65e1c55c79f3ef154e5aaa3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
package de.bwlehrpool.bwlp_guac;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.environment.Environment;
import org.apache.guacamole.environment.LocalEnvironment;
import org.apache.guacamole.properties.StringGuacamoleProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SlxConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(SlxConfig.class);
private static final Environment ENVIRONMENT;
private static final StringGuacamoleProperty CLIENTS_URL = new StringGuacamoleProperty() {
@Override
public String getName() {
return "slx-client-list-url";
}
};
private static final StringGuacamoleProperty LOGO_URL = new StringGuacamoleProperty() {
@Override
public String getName() {
return "slx-logo-url";
}
};
static {
Environment e;
try {
e = new LocalEnvironment();
} catch (GuacamoleException ex) {
LOGGER.warn("Cannot create LocalEnvironment", ex);
e = null;
}
ENVIRONMENT = e;
}
public static String clientListUrl() {
try {
return ENVIRONMENT.getProperty(CLIENTS_URL);
} catch (GuacamoleException e) {
LOGGER.warn("Cannot get client list url from properties", e);
return null;
}
}
public static String logoUrl() {
try {
return ENVIRONMENT.getProperty(LOGO_URL);
} catch (GuacamoleException e) {
LOGGER.warn("Cannot get logo url from properties", e);
return null;
}
}
}
|