import javax.imageio.*; import java.awt.image.*; import java.awt.*; import java.security.NoSuchAlgorithmException; import java.security.MessageDigest; import java.lang.reflect.*; import java.net.*; import java.io.*; import javax.swing.*; import java.util.regex.*; import java.util.List; import java.util.zip.*; import java.util.*; public class main { static String programID; public static void main(String[] args) throws Exception { print(readTextFile(logFile(), "")); } static String logFile() { return new File(userHome(), ".javax/#745/learnerlog.txt").getPath(); } static void print() { System.out.println(); } static void print(Object o) { System.out.println(o); } public static String readTextFile(String fileName, String defaultContents) throws IOException { return loadTextFile(fileName, defaultContents); } public static String readTextFile(File file, String defaultContents) throws IOException { return loadTextFile(file.getPath(), defaultContents); } static String _userHome; static String userHome() { if (_userHome == null) { /*if (android) _userHome = ((File) call(androidContext, "getFilesDir")).getAbsolutePath(); else*/ _userHome = System.getProperty("user.home"); //System.out.println("userHome: " + _userHome); } return _userHome; } public static String loadTextFile(String fileName, String defaultContents) throws IOException { if (!new File(fileName).exists()) return defaultContents; FileInputStream fileInputStream = new FileInputStream(fileName); InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8"); return loadTextFile(inputStreamReader); } public static String loadTextFile(Reader reader) throws IOException { StringBuilder builder = new StringBuilder(); try { BufferedReader bufferedReader = new BufferedReader(reader); String line; while ((line = bufferedReader.readLine()) != null) builder.append(line).append('\n'); } finally { reader.close(); } return builder.length() == 0 ? "" : builder.substring(0, builder.length()-1); } }