/** scripts are allowed to make XMLRPC/SOAP calls to their origin address, even if it is firewalled */
public static java.net.InetAddress originAddr = null;
+ /** the URL where the initial xwar came from */
+ public static String origin = null;
+
/** see Template.numUnits() for a description */
public static int instantiatedUnits = 0;
if (args.length > startargs) {
if (args[startargs].startsWith("http://")) {
if (Log.on) Log.log(Main.class, "downloading xwar");
+ origin = args[startargs];
URL u = new URL(args[startargs]);
try {
originAddr = InetAddress.getByName(u.getHost());
Resources.loadArchive(new HTTP(args[startargs]).getInputStream());
} else {
-
if (Log.on) Log.log(Main.class, "loading xwar from local filesystem");
// HACK because MSIE turns \'s into /'s in URLs... argh!!
if (Platform.platform.getClass().getName().endsWith("Win32"))
args[startargs] = args[startargs].replace('/', '\\');
File f = new File(args[startargs]);
+ origin = "file://" + f.getAbsolutePath();
if (f.isDirectory()) Resources.loadDirectory(f);
else Resources.loadArchive(new FileInputStream(f));
}