/** * Helper to retrieve a ResourceBundle wrapper from a store path. * * @param path String * @return ResourceBundle * @throws IOException */ private ResourceBundle getBundleFromPath(String path) throws IOException { ResourceBundle result = null; if (container.getSearchPath().hasDocument(path)) { InputStream is = container.getSearchPath().getDocument(path); try { result = new WebScriptPropertyResourceBundle(is, path); } finally { is.close(); } } return result; }
/** * Helper to retrieve a ResourceBundle wrapper from a store path. * * @param path * @return ResourceBundle * @throws IOException */ private ResourceBundle getBundleFromPath(String path) throws IOException { ResourceBundle result = null; if (container.getSearchPath().hasDocument(path)) { InputStream is = container.getSearchPath().getDocument(path); try { result = new WebScriptPropertyResourceBundle(is, path); } finally { is.close(); } } return result; }
/** * Helper to retrieve a ResourceBundle wrapper from a store path. * * @param path String * @return ResourceBundle * @throws IOException */ private ResourceBundle getBundleFromPath(String path) throws IOException { ResourceBundle result = null; if (container.getSearchPath().hasDocument(path)) { InputStream is = container.getSearchPath().getDocument(path); try { result = new WebScriptPropertyResourceBundle(is, path); } finally { is.close(); } } return result; }
input = this.container.getSearchPath().getDocument(configPath); if (input != null)
input = this.container.getSearchPath().getDocument(configPath); if (input != null)
Collection<Store> stores = getContainer().getSearchPath().getStores(); for (Store store : stores)
input = this.container.getSearchPath().getDocument(configPath); if (input != null)
private void installFile(String storePath, String file, String content) { // retrieve appropriate web script store Store store = getContainer().getSearchPath().getStore(storePath); if (store == null) { throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Store path " + storePath + " refers to a store that does not exist"); } try { // determine if file already exists in store if (store.hasDocument(file)) { throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Web Script file " + file + " already exists in store " + storePath); } // create the web script file store.createDocument(file, content); } catch(IOException e) { throw new WebScriptException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to install Web Script file " + file + " into store" + storePath); } }