import java.io.File;
import java.io.FileInputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.*;
import com.threerings.getdown.util.StringUtil;
+import com.threerings.getdown.data.Application;
/** Configuration that comes from our "environment" (command line args, sys props, etc.). */
public final class EnvConfig {
appIdProv + "'"));
}
}
+
+ int skipArgs = 2;
+ // Look for locator file, pass to Application and remove from appArgs
+ String argvLocatorFilename = argv.length > 2 ? argv[2] : null;
+ if (
+ !StringUtil.isBlank(argvLocatorFilename)
+ && argvLocatorFilename.toLowerCase().endsWith("."+Application.LOCATOR_FILE_EXTENSION)
+ ) {
+ notes.add(Note.info("locatorFilename in args: '"+argv[2]+"'"));
+ Application.setLocatorFile(argvLocatorFilename);
+
+ skipArgs++;
+ }
- // ensure that we were able to fine an app dir
+ // ensure that we were able to find an app dir
if (appDir == null) {
return null; // caller will report problem to user
}
return null;
}
- // pass along anything after the first two args as extra app args
- List<String> appArgs = argv.length > 2 ?
- Arrays.asList(argv).subList(2, argv.length) :
+ // pass along anything after the first two (or three) args as extra app args
+ List<String> appArgs = argv.length > skipArgs ?
+ Arrays.asList(argv).subList(skipArgs, argv.length) :
Collections.<String>emptyList();
// load X.509 certificate if it exists