From c0ea432776b1147b61b437d238ccad84de2de953 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 15 Aug 2003 23:23:05 +0000 Subject: [PATCH] Changed dynamic resource URL handling such that it must be set programmatically or it will be assumed to be the same as the normal resource URL. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2774 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/resource/ResourceManager.java | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/java/com/threerings/resource/ResourceManager.java b/src/java/com/threerings/resource/ResourceManager.java index 8f9a3cea0..87afbbc60 100644 --- a/src/java/com/threerings/resource/ResourceManager.java +++ b/src/java/com/threerings/resource/ResourceManager.java @@ -1,5 +1,5 @@ // -// $Id: ResourceManager.java,v 1.34 2003/08/09 05:51:12 mdb Exp $ +// $Id: ResourceManager.java,v 1.35 2003/08/15 23:23:05 mdb Exp $ package com.threerings.resource; @@ -264,25 +264,7 @@ public class ResourceManager ", error=" + mue + "]."); } - // now attempt to locate the dynamic resource URL - try { - String dynResURL = System.getProperty("dyn_rsrc_url"); - if (dynResURL != null) { - // make sure there's a slash at the end of the URL - if (!dynResURL.endsWith("/")) { - dynResURL += "/"; - } - try { - _drurl = new URL(dynResURL); - } catch (MalformedURLException mue) { - Log.warning("Invalid dynamic resource URL " + - "[url=" + dynResURL + ", error=" + mue + "]."); - } - } - } catch (SecurityException se) { - } - - // if no dynamic resource URL was specified, use the normal + // if no dynamic resource URL has been specified, use the normal // resource URL in its stead if (_drurl == null) { _drurl = _rurl; @@ -315,6 +297,26 @@ public class ResourceManager } } + /** + * Configures the resource manager with a custom dynamic resource + * URL. If it is not thusly configured, it will use the normal + * resource URL for dynamic resources. + */ + public void setDynamicResourceURL (String dynResURL) + { + // make sure there's a slash at the end of the URL + if (!dynResURL.endsWith("/")) { + dynResURL += "/"; + } + + try { + _drurl = new URL(dynResURL); + } catch (MalformedURLException mue) { + Log.warning("Invalid dynamic resource URL " + + "[url=" + dynResURL + ", error=" + mue + "]."); + } + } + /** * Create the resource bundle for the specified set and path. */