Browse Source
Merge in DESIGN/design from ~FANGLEI/design:feature/x to feature/x * commit '76430cddae7f9d578acf572c3a2a05ed29d0a104': CHART-22040 设计器增加排序的按钮 REPORT-62439 还原 REPORT-62439 国际化-屏蔽海外设计器内登录入口feature/x
fanglei
3 years ago
5 changed files with 73 additions and 17 deletions
@ -0,0 +1,52 @@
|
||||
package com.fr.design.config; |
||||
|
||||
import com.fr.general.IOUtils; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StableUtils; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import java.io.BufferedInputStream; |
||||
import java.io.FileInputStream; |
||||
import java.io.FileNotFoundException; |
||||
import java.io.InputStream; |
||||
import java.util.Properties; |
||||
|
||||
public class DesignerProperties { |
||||
private static DesignerProperties holder = null; |
||||
private boolean supportLoginEntry = true; |
||||
|
||||
public DesignerProperties() { |
||||
String filePath = StableUtils.pathJoin(StableUtils.getInstallHome(), "/config/config.properties"); |
||||
InputStream is = null; |
||||
try { |
||||
is = new BufferedInputStream(new FileInputStream(filePath)); |
||||
Properties ps = new Properties(); |
||||
ps.load(is); |
||||
this.initProperties(ps); |
||||
} catch (FileNotFoundException e) { |
||||
// ignore
|
||||
} catch (Exception e) { |
||||
FineLoggerFactory.getLogger().error(e, e.getMessage()); |
||||
} finally { |
||||
IOUtils.close(is); |
||||
} |
||||
} |
||||
|
||||
public static DesignerProperties getInstance() { |
||||
if (holder == null) { |
||||
holder = new DesignerProperties(); |
||||
} |
||||
return holder; |
||||
} |
||||
|
||||
private void initProperties(Properties ps) { |
||||
String supportLoginEntry = ps.getProperty("supportLoginEntry"); |
||||
if (StringUtils.isNotEmpty(supportLoginEntry)) { |
||||
this.supportLoginEntry = Boolean.valueOf(supportLoginEntry); |
||||
} |
||||
} |
||||
|
||||
public boolean isSupportLoginEntry() { |
||||
return supportLoginEntry; |
||||
} |
||||
} |
Loading…
Reference in new issue