fix: Base64 -> java.util.Base64 변경 적용

main
minuk926 2 years ago
parent 62c7fa1839
commit 6d88f0d526

@ -5,6 +5,7 @@ import java.io.IOException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -19,7 +20,6 @@ import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.crypto.codec.Base64;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -456,7 +456,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
if(petiFileNm.contains(".png")) { if(petiFileNm.contains(".png")) {
method = clz.getMethod("getApndfilcont" + idx, null); method = clz.getMethod("getApndfilcont" + idx, null);
String petiFileStr = (String)method.invoke(apndFileDTO, null); String petiFileStr = (String)method.invoke(apndFileDTO, null);
mfList.add(CommUtils.createMutipartFileFromBytes(petiFileNm, makePath, Base64.decode(petiFileStr.getBytes()), true)); mfList.add(CommUtils.createMutipartFileFromBytes(petiFileNm, makePath, Base64.getDecoder().decode(petiFileStr.getBytes()), true));
break; break;
} }
} }
@ -506,7 +506,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
method = clz.getMethod("getApndfilcont" + fileIdx, null); method = clz.getMethod("getApndfilcont" + fileIdx, null);
String petiFileStr = (String)method.invoke(apndFileDTO, null); String petiFileStr = (String)method.invoke(apndFileDTO, null);
mfList.add(CommUtils.createMutipartFileFromBytes(petiFileNm, makePath, Base64.decode(petiFileStr.getBytes()), true)); mfList.add(CommUtils.createMutipartFileFromBytes(petiFileNm, makePath, Base64.getDecoder().decode(petiFileStr.getBytes()), true));
//method.invoke(apndFileDTO, StringUtils.cleanPath(makePath + mf.getOriginalFilename())); //method.invoke(apndFileDTO, StringUtils.cleanPath(makePath + mf.getOriginalFilename()));
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {

@ -5,6 +5,7 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -18,7 +19,6 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
import org.json.simple.JSONArray; import org.json.simple.JSONArray;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
@ -33,8 +33,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.bind.support.SessionStatus;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.mng.admin.service.XitAdminDbMngService;
import kr.xit.framework.biz.mng.admin.model.XitAdminDbMngSearchVO; import kr.xit.framework.biz.mng.admin.model.XitAdminDbMngSearchVO;
import kr.xit.framework.biz.mng.admin.service.XitAdminDbMngService;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
@ -436,7 +436,7 @@ public class XitAdminDbMngController {
String charSet= "UTF-8"; String charSet= "UTF-8";
// 텍스트를 BASE64 형식으로 디코드 한다. // 텍스트를 BASE64 형식으로 디코드 한다.
byte[] ctBytes = Base64.decodeBase64(ciphertext.getBytes(charSet)); byte[] ctBytes = Base64.getDecoder().decode(ciphertext.getBytes(charSet));
// 솔트를 구한다. (생략된 8비트는 Salted__ 시작되는 문자열이다.) // 솔트를 구한다. (생략된 8비트는 Salted__ 시작되는 문자열이다.)
byte[] saltBytes = Arrays.copyOfRange(ctBytes, 8, 16); byte[] saltBytes = Arrays.copyOfRange(ctBytes, 8, 16);

@ -1,8 +1,7 @@
package kr.xit.framework.core.utils; package kr.xit.framework.core.utils;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.util.Base64;
import org.apache.commons.codec.binary.Base64;
/** /**
* *
@ -40,6 +39,6 @@ public class XitScrtyUtil {
hashValue = md.digest(password.getBytes()); hashValue = md.digest(password.getBytes());
return new String(Base64.encodeBase64(hashValue)); return new String(Base64.getEncoder().encode(hashValue));
} }
} }

@ -14,7 +14,7 @@ import lombok.extern.slf4j.Slf4j;
public class BizRuntimeException extends RuntimeException { public class BizRuntimeException extends RuntimeException {
private String code; private String code;
private String message; //private String message;
private Object[] arguments; private Object[] arguments;
@ -24,8 +24,8 @@ public class BizRuntimeException extends RuntimeException {
super(); super();
} }
private BizRuntimeException(String code) { private BizRuntimeException(String message) {
super(code); super(message);
} }
private BizRuntimeException(Throwable cause) { private BizRuntimeException(Throwable cause) {
@ -70,14 +70,6 @@ public class BizRuntimeException extends RuntimeException {
this.code = errorCode; this.code = errorCode;
} }
public String getMessage(String message) {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
public Object[] getArguments() { public Object[] getArguments() {
return arguments; return arguments;
} }

Loading…
Cancel
Save