GeSHi (java):
/*--------------------------------------------------------------------------
CheckFileExists.java
******************
By: HappyFace http://www.engineeringserver.com
Contact: info [@] engineeringserver.com
Version: 6/june/2009
"*****************
Description:
checks if a file excists, if not create it
To do:
//----------------------------------------------------------------------*/
package console;
import java.io.File;
import java.io.IOException;
public class CheckFileExists {
public static void main
(String[] args
){ String fileStr =
"c:\\DefaultTextFile.txt";
if(!f.exists()){
try {
f.createNewFile();
System.
out.
println(fileStr +
" created");
e.printStackTrace();
}
}
else{
System.
out.
println(fileStr +
" not created");
}
}
}
Created by GeSHI 1.0.7.20