public class CLCOMP {
public static void main(String[] args) {
String filePath = "D:\\TEMP\\query.txt";
String line = null;
BufferedReader inFile = null;
inFile = myFile.myOpen( filePath );
if ( inFile == null ) {
System.out.println( filePath + " を open できません" );
return;
}
try {
while ( ( line = inFile.readLine() ) != null) {
System.out.println( line );
}
inFile.close();
}
catch ( Exception e ) {
System.out.println( e.getMessage() );
}
}
}
class myFile {
static public BufferedReader myOpen( String filePath ) {
BufferedReader inFile = null;
try {
inFile = new BufferedReader( new FileReader( filePath ) );
}
catch ( Exception e ) {
return null;
}
return inFile;
}
}
|