org.spincast.website.AppConfigDefault Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
package org.spincast.website;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spincast.core.guice.TestingMode;
import org.spincast.plugins.config.SpincastConfigDefault;
import org.spincast.plugins.config.SpincastConfigPluginConfig;
import org.spincast.shaded.org.apache.commons.lang3.StringUtils;
import org.spincast.shaded.org.apache.commons.lang3.tuple.Pair;
import com.google.inject.Inject;
/**
* Application configurations
*/
public class AppConfigDefault extends SpincastConfigDefault implements AppConfig {
protected static final Logger logger = LoggerFactory.getLogger(AppConfigDefault.class);
private List> adminUsernamesPasswords;
/**
* Constructor
*/
@Inject
public AppConfigDefault(SpincastConfigPluginConfig spincastConfigPluginConfig, @TestingMode boolean testingMode) {
super(spincastConfigPluginConfig, testingMode);
}
@Override
public String getPublicUrlBase() {
return getString("api.base", super.getPublicUrlBase());
}
@Override
public int getHttpServerPort() {
return getInteger("server.port.http", -1);
}
@Override
public int getHttpsServerPort() {
return getInteger("server.port.https", 44420);
}
@Override
public String getHttpsKeyStorePath() {
return "certificates/devKeyStore.jks";
}
@Override
public String getHttpsKeyStoreType() {
return "JKS";
}
@Override
public String getHttpsKeyStoreStorePass() {
return "myStorePass";
}
@Override
public String getHttpsKeyStoreKeyPass() {
return "myKeyPass";
}
@Override
public String getEnvironmentName() {
return getString("environment.name", super.getEnvironmentName());
}
@Override
public boolean isDevelopmentMode() {
return getBoolean("environment.isDebug", super.isDevelopmentMode());
}
@Override
protected String getSpincastWritableDirPath() {
return getString("writableDirPath", super.getSpincastWritableDirPath());
}
@Override
public int getNbrNewsEntriesOnNewsPage() {
return 5;
}
@Override
public int getNbrNewsEntriesPerFeedRequest() {
return 25;
}
@Override
public List> getAdminUsernamesPasswords() {
if (this.adminUsernamesPasswords == null) {
List