fix #1603 add FESS_APP_TYPE

This commit is contained in:
Shinsuke Sugaya 2018-04-12 14:50:47 +09:00
parent 575c9aceff
commit 7ca78e8cb4

View file

@ -31,6 +31,10 @@ import org.codelibs.fess.mylasta.direction.FessConfig;
import org.lastaflute.web.util.LaServletContextUtil;
public class ResourceUtil {
private static final String FESS_APP_TYPE = "FESS_APP_TYPE";
private static final String FESS_APP_DOCKER = "docker";
protected ResourceUtil() {
// nothing
}
@ -45,6 +49,13 @@ public class ResourceUtil {
}
public static Path getConfPath(final String... names) {
final String fessAppType = System.getenv(FESS_APP_TYPE);
if (FESS_APP_DOCKER.equalsIgnoreCase(fessAppType)) {
final Path confPath = Paths.get("/opt/fess", names);
if (Files.exists(confPath)) {
return confPath;
}
}
final String confPath = System.getProperty(Constants.FESS_CONF_PATH);
if (StringUtil.isNotBlank(confPath)) {
return Paths.get(confPath, names);