• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
chominsoo4245 / mjon_git star
Forked from hylee / mjon_git
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB
  • Files
  • Commit
  • Branches
mjon_gitsrcmainjavaitncomcmmserviceEgovProperties.java
Download as .zip file
File name
Commit message
Commit date
DATABASE
mjon_git
2023-06-12
src/main
팩스 금일/금월/금년 통계 쿼리수정 => (발송건수X매수)
2023-08-01
.codetogether.ignore
mjon_git
2023-06-12
.gitignore
gitignore 적용
2023-06-12
pom.xml
mjon_git
2023-06-12
File name
Commit message
Commit date
java
팩스 전송목록에 일/월/년 누적 성공건수 통계 추가
2023-08-01
resources
팩스 금일/금월/금년 통계 쿼리수정 => (발송건수X매수)
2023-08-01
webapp
팩스 전송목록에 일/월/년 누적 성공건수 통계 추가
2023-08-01
File name
Commit message
Commit date
egovframework
mjon_git
2023-06-12
itn
팩스 전송목록에 일/월/년 누적 성공건수 통계 추가
2023-08-01
File name
Commit message
Commit date
com
pdf 뷰어 커밋
2023-07-31
let
팩스 전송목록에 일/월/년 누적 성공건수 통계 추가
2023-08-01
web
이준호 문자온 커밋 - IP 받아오는 방식 수정
2023-07-28
File name
Commit message
Commit date
api/web
mjon_git
2023-06-12
cmm
pdf 뷰어 커밋
2023-07-31
sym/log/ulg
mjon_git
2023-06-12
usr/search/web
mjon_git
2023-06-12
uss
feat: pms-#3232 [관리자] 스케쥴에 의해 IP 차단 시 슬렉 알림 추가 완료
2023-07-03
utl
mjon_git
2023-06-12
File name
Commit message
Commit date
aspect
mjon_git
2023-06-12
captcha
mjon_git
2023-06-12
filter
mjon_git
2023-06-12
interceptor
이준호 문자온 커밋 - IP 받아오는 방식 수정
2023-07-28
service
mjon_git
2023-06-12
taglibs
mjon_git
2023-06-12
util
pdf 뷰어 커밋
2023-07-31
web
pdf 뷰어 커밋
2023-07-31
AltibaseClobStringTypeHandler.java
mjon_git
2023-06-12
ComDefaultCodeVO.java
mjon_git
2023-06-12
ComDefaultVO.java
mjon_git
2023-06-12
EgovComCrossSiteHndlr.java
mjon_git
2023-06-12
EgovComExcepHndlr.java
mjon_git
2023-06-12
EgovComOthersExcepHndlr.java
mjon_git
2023-06-12
EgovComTraceHandler.java
mjon_git
2023-06-12
EgovMessageSource.java
mjon_git
2023-06-12
EgovMultiPartEmail.java
mjon_git
2023-06-12
EgovWebUtil.java
mjon_git
2023-06-12
ImagePaginationRenderer.java
mjon_git
2023-06-12
ImagePaginationRendererWeb.java
mjon_git
2023-06-12
JsonResult.java
mjon_git
2023-06-12
LoginVO.java
선거문자 비로그인시 발신번호 조회가 안되도록 수정
2023-07-27
ReadVO.java
mjon_git
2023-06-12
SessionVO.java
mjon_git
2023-06-12
UserVO.java
mjon_git
2023-06-12
File name
Commit message
Commit date
impl
mjon_git
2023-06-12
CmmnDetailCode.java
mjon_git
2023-06-12
EgovCmmUseService.java
mjon_git
2023-06-12
EgovFileMngService.java
mjon_git
2023-06-12
EgovFileMngUtil.java
mjon_git
2023-06-12
EgovProperties.java
mjon_git
2023-06-12
EgovUserDetailsService.java
mjon_git
2023-06-12
FileVO.java
mjon_git
2023-06-12
Globals.java
mjon_git
2023-06-12
ReadService.java
mjon_git
2023-06-12
hylee 2023-06-12 06fded7 mjon_git UNIX
Raw Open in browser Change history
package itn.com.cmm.service; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import itn.com.cmm.EgovWebUtil; import itn.com.cmm.util.EgovResourceCloseHelper; //import java.io.FileNotFoundException; //import java.io.IOException; //import java.util.Properties; /** * Class Name : EgovProperties.java * Description : properties값들을 파일로부터 읽어와 Globals클래스의 정적변수로 로드시켜주는 클래스로 * 문자열 정보 기준으로 사용할 전역변수를 시스템 재시작으로 반영할 수 있도록 한다. * Modification Information * * 수정일 수정자 수정내용 * ------- -------- --------------------------- * 2009.01.19 박지욱 최초 생성 * 2011.07.20 서준식 Globals파일의 상대경로를 읽은 메서드 추가 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * * @author 공통 서비스 개발팀 박지욱 * @since 2009. 01. 19 * @version 1.0 * @see * */ public class EgovProperties{ private static final Logger LOGGER = LoggerFactory.getLogger(EgovProperties.class); //프로퍼티값 로드시 에러발생하면 반환되는 에러문자열 public static final String ERR_CODE =" EXCEPTION OCCURRED"; public static final String ERR_CODE_FNFE =" EXCEPTION(FNFE) OCCURRED"; public static final String ERR_CODE_IOE =" EXCEPTION(IOE) OCCURRED"; //파일구분자 static final char FILE_SEPARATOR = File.separatorChar; //프로퍼티 파일의 물리적 위치 //public static final String GLOBALS_PROPERTIES_FILE = System.getProperty("user.home") + FILE_SEPARATOR + "egovProps" +FILE_SEPARATOR + "globals.properties"; //public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath() + FILE_SEPARATOR+ ".." + FILE_SEPARATOR + ".." + FILE_SEPARATOR; public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath().substring(0, EgovProperties.class.getResource("").getPath().lastIndexOf("com")); public static final String GLOBALS_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "egovProps" + FILE_SEPARATOR + "globals.properties"; /** * 인자로 주어진 문자열을 Key값으로 하는 상대경로 프로퍼티 값을 절대경로로 반환한다(Globals.java 전용) * @param keyName String * @return String public static String getPathProperty(String keyName){ String value = ERR_CODE; value="99"; debug(GLOBALS_PROPERTIES_FILE + " : " + keyName); FileInputStream fis = null; try{ Properties props = new Properties(); fis = new FileInputStream(GLOBALS_PROPERTIES_FILE); props.load(new java.io.BufferedInputStream(fis)); value = props.getProperty(keyName).trim(); value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value; }catch(FileNotFoundException fne){ debug(fne); }catch(IOException ioe){ debug(ioe); }catch(Exception e){ debug(e); }finally{ try { if (fis != null) fis.close(); } catch (Exception ex) { ex.printStackTrace(); } } return value; } */ /** * 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 값을 반환한다(Globals.java 전용) * @param keyName String * @return String */ public static String getProperty(String keyName) { String value = ""; LOGGER.debug("getProperty : {} = {}", GLOBALS_PROPERTIES_FILE, keyName); FileInputStream fis = null; try { Properties props = new Properties(); fis = new FileInputStream(EgovWebUtil.filePathBlackList(GLOBALS_PROPERTIES_FILE)); props.load(new BufferedInputStream(fis)); if (props.getProperty(keyName) == null) { return ""; } value = props.getProperty(keyName).trim(); } catch (FileNotFoundException fne) { LOGGER.debug("Property file not found.", fne); throw new RuntimeException("Property file not found", fne); } catch (IOException ioe) { LOGGER.debug("Property file IO exception", ioe); throw new RuntimeException("Property file IO exception", ioe); } finally { EgovResourceCloseHelper.close(fis); } return value; } /** * 주어진 파일에서 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 상대 경로값을 절대 경로값으로 반환한다 * @param fileName String * @param key String * @return String public static String getPathProperty(String fileName, String key){ FileInputStream fis = null; try{ java.util.Properties props = new java.util.Properties(); fis = new FileInputStream(fileName); props.load(new java.io.BufferedInputStream(fis)); fis.close(); String value = props.getProperty(key); value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value; return value; }catch(java.io.FileNotFoundException fne){ return ERR_CODE_FNFE; }catch(java.io.IOException ioe){ return ERR_CODE_IOE; }finally{ try { if (fis != null) fis.close(); } catch (Exception ex) { ex.printStackTrace(); } } } */ /** * 주어진 파일에서 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 값을 반환한다 * @param fileName String * @param key String * @return String public static String getProperty(String fileName, String key){ FileInputStream fis = null; try{ java.util.Properties props = new java.util.Properties(); fis = new FileInputStream(fileName); props.load(new java.io.BufferedInputStream(fis)); fis.close(); String value = props.getProperty(key); return value; }catch(java.io.FileNotFoundException fne){ return ERR_CODE_FNFE; }catch(java.io.IOException ioe){ return ERR_CODE_IOE; }finally{ try { if (fis != null) fis.close(); } catch (Exception ex) { ex.printStackTrace(); } } } */ /** * 주어진 프로파일의 내용을 파싱하여 (key-value) 형태의 구조체 배열을 반환한다. * @param property String * @return ArrayList */ @SuppressWarnings("unused") public static ArrayList<Map<String, String>> loadPropertyFile(String property){ // key - value 형태로 된 배열 결과 ArrayList<Map<String, String>> keyList = new ArrayList<Map<String, String>>(); String src = property.replace('\\', FILE_SEPARATOR).replace('/', FILE_SEPARATOR); FileInputStream fis = null; try { File srcFile = new File(src); if (srcFile.exists()) { java.util.Properties props = new java.util.Properties(); fis = new FileInputStream(src); props.load(new java.io.BufferedInputStream(fis)); fis.close(); int i = 0; Enumeration<?> plist = props.propertyNames(); if (plist != null) { while (plist.hasMoreElements()) { Map<String, String> map = new HashMap<String, String>(); String key = (String)plist.nextElement(); map.put(key, props.getProperty(key)); keyList.add(map); } } } } catch (Exception ex){ debug("EX:"+ex); } finally { try { if (fis != null) fis.close(); } catch (Exception ex) { debug("EX:"+ex);//ex.printStackTrace(); } } return keyList; } /** * 시스템 로그를 출력한다. * @param obj Object */ private static void debug(Object obj) { if (obj instanceof java.lang.Exception) { //((Exception)obj).printStackTrace(); //System.out.println("DEBUG: " + obj); // 2011.10.10 보안점검 후속조치 LOGGER.debug("IGNORED: {}", ((Exception)obj).getMessage()); } } }

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up