/** * Sets the URL to a new value. We will load only one of these URL's. The list provides * alternates. * * @param newURL Array of candidate URL strings * @param numValid The number of valid values to copy from the array */ public void setUrl(String[] newURL, int numValid) { if (numValid > 0) { if (worldURL != null) vfURL = URLChecker.checkURLs(worldURL, newURL, false); else vfURL = newURL; } else { vfURL = FieldConstants.EMPTY_MFSTRING; } if (!inSetup) { hasChanged[FIELD_URL] = true; fireFieldChanged(FIELD_URL); } }
/** * Set the world URL so that any relative URLs may be corrected to the fully qualified version. * Guaranteed to be non-null. * * @param url The world URL. */ public void setWorldUrl(String url) { if ((url == null) || (url.length() == 0)) return; // check for a trailing slash. If it doesn't have one, append it. if (url.charAt(url.length() - 1) != '/') { worldURL = url + '/'; } else { worldURL = url; } if (vfURL != null) { URLChecker.checkURLsInPlace(worldURL, vfURL, false); } }