More javadoc, minor cleanup
This commit is contained in:
parent
72f8143d5e
commit
998f95bfc0
|
@ -221,7 +221,7 @@ public class Main
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Alternative start.config file
|
||||||
if (arg.startsWith("--config="))
|
if (arg.startsWith("--config="))
|
||||||
{
|
{
|
||||||
_startConfig = arg.substring(9);
|
_startConfig = arg.substring(9);
|
||||||
|
@ -230,6 +230,9 @@ public class Main
|
||||||
|
|
||||||
|
|
||||||
// Special internal indicator that jetty was started by the jetty.sh Daemon
|
// Special internal indicator that jetty was started by the jetty.sh Daemon
|
||||||
|
// All this does is setup a start.log that captures startup console output
|
||||||
|
// in the tiny window of time before the real logger kicks in.
|
||||||
|
// Useful for capturing when things go horribly wrong
|
||||||
if ("--daemon".equals(arg))
|
if ("--daemon".equals(arg))
|
||||||
{
|
{
|
||||||
File startDir = new File(System.getProperty("jetty.logs","logs"));
|
File startDir = new File(System.getProperty("jetty.logs","logs"));
|
||||||
|
@ -260,6 +263,7 @@ public class Main
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start Property (syntax similar to System Property)
|
||||||
if (arg.startsWith("-D"))
|
if (arg.startsWith("-D"))
|
||||||
{
|
{
|
||||||
String[] assign = arg.substring(2).split("=",2);
|
String[] assign = arg.substring(2).split("=",2);
|
||||||
|
@ -278,6 +282,7 @@ public class Main
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Anything else is a JVM argument
|
||||||
if (arg.startsWith("-"))
|
if (arg.startsWith("-"))
|
||||||
{
|
{
|
||||||
_jvmArgs.add(arg);
|
_jvmArgs.add(arg);
|
||||||
|
@ -379,8 +384,7 @@ public class Main
|
||||||
location.replaceAll("/",File.separator);
|
location.replaceAll("/",File.separator);
|
||||||
File file = new File(location);
|
File file = new File(location);
|
||||||
|
|
||||||
if (Config.isDebug())
|
Config.debug("Download to %s %s",file.getAbsolutePath(),(file.exists()?"[Exists!]":""));
|
||||||
System.err.println("Download to "+file.getAbsolutePath()+(file.exists()?" Exists!":""));
|
|
||||||
if (file.exists())
|
if (file.exists())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -536,18 +540,34 @@ public class Main
|
||||||
System.exit(EXIT_USAGE);
|
System.exit(EXIT_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
String path(String path)
|
/**
|
||||||
|
* Replace/Shorten arbitrary path with property strings "${jetty.home}" or "${jetty.base}" where appropriate.
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* the path to shorten
|
||||||
|
* @return the potentially shortened path
|
||||||
|
*/
|
||||||
|
private String path(String path)
|
||||||
{
|
{
|
||||||
if (path==null)
|
if (path == null)
|
||||||
|
{
|
||||||
return path;
|
return path;
|
||||||
|
}
|
||||||
if (path.startsWith(_config.getJettyHome()))
|
if (path.startsWith(_config.getJettyHome()))
|
||||||
path = "${jetty.home}" + path.substring(_config.getJettyHome().length());
|
{
|
||||||
if (_config.getJettyBase()!=null && path.startsWith(_config.getJettyBase()))
|
return "${jetty.home}" + path.substring(_config.getJettyHome().length());
|
||||||
path = "${jetty.base}" + path.substring(_config.getJettyBase().length());
|
}
|
||||||
|
if (_config.getJettyBase() != null && path.startsWith(_config.getJettyBase()))
|
||||||
|
{
|
||||||
|
return "${jetty.base}" + path.substring(_config.getJettyBase().length());
|
||||||
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
String path(File file)
|
/**
|
||||||
|
* Convenience method for <code>path(file.getCanonicalPath())</code>
|
||||||
|
*/
|
||||||
|
private String path(File file)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -679,7 +699,7 @@ public class Main
|
||||||
System.out.println(cmd.toString());
|
System.out.println(cmd.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Informational command line, don't run jetty
|
||||||
if (_noRun)
|
if (_noRun)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1214,7 +1234,7 @@ public class Main
|
||||||
/**
|
/**
|
||||||
* Convert a start.ini format file into an argument list.
|
* Convert a start.ini format file into an argument list.
|
||||||
*/
|
*/
|
||||||
List<String> loadStartIni(File ini,String name)
|
private List<String> loadStartIni(File ini,String name)
|
||||||
{
|
{
|
||||||
if (ini==null || !ini.exists() || ini.isDirectory() || !ini.canRead())
|
if (ini==null || !ini.exists() || ini.isDirectory() || !ini.canRead())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue