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); } }