import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URI;
void doMain(String[] args)
{
System.setSecurityManager(null);
+
+ // set stdout and stderr to file if launched by getdown
+ String appdirString = System.getProperty("getdownappdir");
+ if (appdirString != null)
+ {
+ String logFilename = "output.log";
+ File logFile = new File(appdirString, logFilename);
+ if (logFile.exists())
+ {
+ logFile.delete();
+ }
+ try
+ {
+ PrintStream logOut = new PrintStream(new FileOutputStream(logFile),
+ true);
+ System.setOut(logOut);
+ System.setErr(logOut);
+
+ } catch (IOException ioe)
+ {
+ System.err.println("Failed to open debug log [path="
+ + logFile.getAbsolutePath() + ", exception=" + ioe + "]");
+ }
+ // if we've redirected our log output, note where to
+ if (logFile != null)
+ {
+ System.out.println("Logging to '" + logFile + "'.");
+ }
+
+ }
+
System.out
.println("Java version: " + System.getProperty("java.version"));
System.out.println(System.getProperty("os.arch") + " "
// Move any new getdown-launcher-new.jar into place over old
// getdown-launcher.jar
- String appdirString = System.getProperty("getdownappdir");
+ // String appdirString = System.getProperty("getdownappdir");
if (appdirString != null && appdirString.length() > 0)
{
final File appdir = new File(appdirString);