Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- public class main {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws IOException{
- timeKeepHome ja = new timeKeepHome();
- //ja.setVisible(true);
- fileTimeLog log = new fileTimeLog();
- log.checkFile();
- }
- }
- import java.io.IOException;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintWriter;
- import java.util.Scanner;
- import java.util.Date;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Formatter;
- public class fileTimeLog
- {
- File log = new File("log/sixWeek.dat");
- File folder = new File("log");
- PrintWriter logW = new PrintWriter("log/sixWeek.dat");
- public fileTimeLog() throws IOException
- {
- System.out.println("successful");
- checkFile();
- }
- public void checkFile() throws IOException
- {
- if(!(log.exists()))
- {
- createFile();
- }
- }
- public void saveTime() throws IOException
- {
- }
- public void saveDate()
- {
- }
- public void createFile() throws IOException
- {
- folder.mkdir();
- logW = new PrintWriter(log);
- logW.println("DONT MODIFY THIS FILE IF UNLESS YOU KNOW WHAT YOUR ARE DOING ");
- logW.close();
- }
- }
- Exception in thread "main" java.io.FileNotFoundException: logsixWeek.dat (The system cannot find the path specified)
- at java.io.FileOutputStream.open0(Native Method)
- at java.io.FileOutputStream.open(FileOutputStream.java:270)
- at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
- at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
- at java.io.PrintWriter.<init>(PrintWriter.java:184)
- at fileTimeLog.<init>(fileTimeLog.java:17)
- at main.main(main.java:18)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement