본문 바로가기
반응형

프로그래밍/JAVA, JSP49

파비콘(favicon) 만들기/적용 아래 사이트에서 이미지를 등록후 파비콘(favicon)을 만들수 있다. 참고 : www.xiconeditor.com 적용 방법은 아래와 같이 태그에 넣으면 된다. 2013. 11. 13.
자바(JAVA) BASE64 암호화/복호화 import sun.misc.*; import java.io.*; public class Base64Utils { /** * Base64Encoding 방식으로 바이트 배열을 아스키 문자열로 인코딩한다. * In-Binany, Out-Ascii * * @param encodeBytes 인코딩할 바이트 배열(byte[]) * @return 인코딩된 아스키 문자열(String) */ public static String encode(byte[] encodeBytes) { byte[] buf = null; String strResult = null; BASE64Encoder base64Encoder = new BASE64Encoder(); ByteArrayInputStream bin = new ByteArra.. 2013. 11. 13.
자바(JAVA) 윤달 구하기 int year = Integer.parseInt(date.substring(0, 4)); int month = Integer.parseInt(date.substring(4, 6)); int cnt = 0; if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12){ cnt = 32; }else if(month==4 || month==6 || month==9 || month==11){ cnt = 31; }else if(month==2){ if(year%400 == 0 || (year%4 == 0 && year%100 != 0)){ cnt = 30; }else{ cnt = 29; } } 2013. 11. 13.
자바(JAVA) 파일 다운로드 FileInputStream fin = null; OutputStream os = null; File file = null; String path = "/testServer/voice/"; String fileName = "testFile.exe"; String sFilePath = path + fileName; try{ file = new File(sFilePath); fin = new FileInputStream(file); }catch(FileNotFoundException fnfe){ System.out.println("FILE_ERROR..."); } response.reset(); if(fin != null){ String agentType = request.getHeader("User-Age.. 2013. 11. 13.
반응형