|
@@ -5,6 +5,7 @@ import org.artofsolving.jodconverter.office.OfficeUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedReader;
|
|
@@ -29,6 +30,7 @@ public class ConfigRefreshComponent {
|
|
public static final String DEFAULT_FTP_USERNAME = null;
|
|
public static final String DEFAULT_FTP_USERNAME = null;
|
|
public static final String DEFAULT_FTP_PASSWORD = null;
|
|
public static final String DEFAULT_FTP_PASSWORD = null;
|
|
public static final String DEFAULT_FTP_CONTROL_ENCODING = "UTF-8";
|
|
public static final String DEFAULT_FTP_CONTROL_ENCODING = "UTF-8";
|
|
|
|
+ public static final String BASE_URL = null;
|
|
|
|
|
|
|
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
@@ -53,6 +55,7 @@ public class ConfigRefreshComponent {
|
|
String ftpPassword;
|
|
String ftpPassword;
|
|
String ftpControlEncoding;
|
|
String ftpControlEncoding;
|
|
String configFilePath = OfficeUtils.getCustomizedConfigPath();
|
|
String configFilePath = OfficeUtils.getCustomizedConfigPath();
|
|
|
|
+ String baseUlr;
|
|
while (true) {
|
|
while (true) {
|
|
FileReader fileReader = new FileReader(configFilePath);
|
|
FileReader fileReader = new FileReader(configFilePath);
|
|
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
|
BufferedReader bufferedReader = new BufferedReader(fileReader);
|
|
@@ -67,6 +70,7 @@ public class ConfigRefreshComponent {
|
|
ftpControlEncoding = properties.getProperty("ftp.control.encoding", DEFAULT_FTP_CONTROL_ENCODING);
|
|
ftpControlEncoding = properties.getProperty("ftp.control.encoding", DEFAULT_FTP_CONTROL_ENCODING);
|
|
textArray = text.split(",");
|
|
textArray = text.split(",");
|
|
mediaArray = media.split(",");
|
|
mediaArray = media.split(",");
|
|
|
|
+ baseUlr = properties.getProperty("base.url", null);
|
|
ConfigConstants.setCacheEnabled(cacheEnabled);
|
|
ConfigConstants.setCacheEnabled(cacheEnabled);
|
|
ConfigConstants.setSimText(textArray);
|
|
ConfigConstants.setSimText(textArray);
|
|
ConfigConstants.setMedia(mediaArray);
|
|
ConfigConstants.setMedia(mediaArray);
|
|
@@ -75,6 +79,9 @@ public class ConfigRefreshComponent {
|
|
ConfigConstants.setFtpUsername(ftpUsername);
|
|
ConfigConstants.setFtpUsername(ftpUsername);
|
|
ConfigConstants.setFtpPassword(ftpPassword);
|
|
ConfigConstants.setFtpPassword(ftpPassword);
|
|
ConfigConstants.setFtpControlEncoding(ftpControlEncoding);
|
|
ConfigConstants.setFtpControlEncoding(ftpControlEncoding);
|
|
|
|
+ if (baseUlr != null && !StringUtils.isEmpty(baseUlr)) {
|
|
|
|
+ ConfigConstants.setBaseUrl(baseUlr);
|
|
|
|
+ }
|
|
bufferedReader.close();
|
|
bufferedReader.close();
|
|
fileReader.close();
|
|
fileReader.close();
|
|
Thread.sleep(1000L);
|
|
Thread.sleep(1000L);
|