/** * Get the Java WebStart codebase. * @return The codebase. */ public URL getCodeBase() { if (m_bs != null) return m_bs.getCodeBase(); return null; } /**
final BasicService bs = (BasicService) ServiceManager.lookup( "javax.jnlp.BasicService"); final URL codeBase = bs.getCodeBase();
import javax.jnlp.*; BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService"); URL codebase = bs.getCodeBase();
private URL fileNameToURL(String name) throws IOException { if (name == null) { throw new IOException("name is not set"); } try { return new URL(bs.getCodeBase(), name); } catch (MalformedURLException e) { throw new IOException("invalid filename \"" + name + "\"", e); } }
private URL fileNameToURL(String name) throws IOException { try { return new URL(bs.getCodeBase(), name); } catch (MalformedURLException e) { throw new LSException("invalid filename \"" + name + "\"", e); } }
/** * Creates new MuffinManager. * @param applet The parent object (ignored). */ public void init(Object applet) { try { m_ps = (PersistenceService)ServiceManager.lookup("javax.jnlp.PersistenceService"); m_bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService"); m_strCodeBase = m_bs.getCodeBase().toString(); } catch (UnavailableServiceException e) { m_ps = null; m_bs = null; } } /**
BasicService bs = (BasicService) ServiceManager .lookup("javax.jnlp.BasicService"); URL baseURL = bs.getCodeBase(); URL configURL = new URL(baseURL, fileName); FileContents fc = ps.get(configURL);
bs = (BasicService) ServiceManager .lookup("javax.jnlp.BasicService"); URL baseURL = bs.getCodeBase();
url = new File(location).toURL(); // Why use file.getCanonicalFile? else url = new URL(ServiceUtil.getBasicService().getCodeBase(), location);