public class FileWriterTest{ public static void main(String[] args){ System.out.println("Start"); String txt="테스트"; String path="D:\\batch\\"; File f=new File(path); String pathFile=""; String fileName="text"; String ext=".txt"; SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd"); Date date = new Date(); String yyyyMMdd=sdf.format(date); pathFile=fileName+"_"+yyyyMMdd+ext; Calendar cal =new Gr..
4. 사용예 java.util.ResourceBundle resource = java.util.ResourceBundle.getBundle("MyResource"); String jdbc_url = resource.getString("jdbc_url"); 위의 간단한 코드는 모든 클래스패스에서 MyResource.properties 파일 등(파일명 검색 규칙은 다음절 참고)이 있는지 찾아서 그 정보를 Resourcebundle 객체(resource)에 저장한다. JSP 파일에서는 다음과 같은 방법으로 사용 가능하다. MyResource.properties 파일 등은 WEB-INF/classes 아래나 jar 파일에 위치해야 한다. (자원파일명 규칙 및 디렉토리는 다음 절을 참조) 출처 https://oh..
package com.aa; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.Toolkit; import java.util.Timer; import java.util.TimerTask; import javax.swing.JFrame; import javax.swing.JLabel; public class Agent extends JFrame{ public static int sec=7; static JFrame frame =null; final static JLabel label = new JLabel(); public void F(JFrame fr..
package com.aa; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLayeredPane; import javax.swing.JPanel; public class LoginFrame extends JFrame{ Buf..
package com.aa; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; public class ImageResize { public static void main(String[] args) throws Exception{ try{ int newWidth=600; int newHeight=600; Image image = ImageIO.read(new File("C:\\workspace\\PCM_TIBERO\\WebContent\\file\\ttt.jpg")); Image resizeImage = image..
public class Monitor { private static Path sharedDirectoryPath; private static WatchKey watchKey; private static WatchService watchService; public static void main(String[] args) throws Exception { System.out.println("Start"); String path = "D:\\test"; String pathFile = "D:\\test\\test.txt"; sharedDirectoryPath = Paths.get(path); try{ watchService = FileSystems.getDefault().newWatchService(); wa..
package com.aa; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; public class ThisWeek { public static void main(String[] args) { String dateString = "20190719"; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date date = new Date(); try{ date = sdf.parse(dateString); System.out.println("date="..
자바 이번주 시작일(월~일), 종료일 구하는 방법 String dateString="20190719"; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date date = new Date(); try{ date = sdf.parse(dateString); }catch(ParseException e){ } Calendar cal = Calendar.getInstance(Locale.KOREA); cal.setTime(date); System.out.println("입력한 날짜:"+sdf.format(cal.getTime()); cal.add(Calendar.DATE, 2- cal.get(Calendar.DAY_OF_WEEK)); System.out.p..
이전 글에서 폴더 모니터링을 봤으니 이번글에서는 파일을 받아 처리하는 부분을 살펴보자. public class Monitor{ private static Path sharedDirectoryPath; private static WatchKey watchKey; private static WatchService watchService; public static void main(String[] args){ String path="D:\\test"; sharedDirectoryPath = Paths.get(path); try{ watchService = FileSystems.getDefault().newWatchService(); watchKey = sharedDirectoryPath.register(wat..
git source 소스 링크 import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardWatchEventKinds; import java.nio.file.WatchEvent; import java.nio.file.WatchKey; import java.nio.file.WatchService; import java.time.LocalDateTime; public class FileObserver { public static void main(String[] args) { String targetDirec..
- Total
- Today
- Yesterday
- 문자열
- 인포믹스
- ocajp
- 파싱
- 이클립스
- 프로씨
- 포인터
- 오라클
- 파이썬
- C언어
- 플러터
- JDBC
- 자바
- esql
- Python
- webix
- php
- 스크래핑
- xe애드온
- XE
- 자바 smtp
- xe addon
- EC
- XE3
- KG
- C
- proc
- 라이믹스
- MySQL
- ocjap
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |