Anonymous avatar Anonymous committed 7e2b22f

Fix configuration of ChempoundWebappLauncher

Comments (0)

Files changed (1)

chempound-webapp/src/main/java/net/chempound/webapp/ChempoundWebappLauncher.java

 import net.chempound.ChempoundConfigurationModule;
 import net.chempound.DefaultChempoundModule;
 import net.chempound.config.BaseUri;
-import net.chempound.config.ChempoundConfiguration;
 import net.chempound.config.DefaultPropertySource;
-import net.chempound.config.StubChempoundConfiguration;
 import org.restlet.Application;
 import org.restlet.Component;
 import org.restlet.data.Protocol;
 
-import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 
  */
 public class ChempoundWebappLauncher {
 
-    private final URI baseUri;
-    private final File workspace;
     private final Stage stage;
 
     public ChempoundWebappLauncher() {
-        this(getBaseUri(), getWorkspace(), Stage.PRODUCTION);
+        this.stage = Stage.PRODUCTION;
     }
 
-    public ChempoundWebappLauncher(final URI baseUri, final File workspace, final Stage stage) {
-        this.baseUri = baseUri;
-        this.workspace = workspace;
-        this.stage = stage;
-    }
-
-
     public static void main(final String[] args) throws Exception {
         final ChempoundWebappLauncher launcher = new ChempoundWebappLauncher();
         launcher.start();
     }
 
     protected Module getConfigurationModule() throws IOException {
-        return new ChempoundConfigurationModule(initConfiguration(), new DefaultPropertySource());
+        return new ChempoundConfigurationModule(new DefaultPropertySource());
     }
 
     protected Module getWebappModule() {
             }
         };
     }
-
-
-    protected ChempoundConfiguration initConfiguration() {
-        return new StubChempoundConfiguration(baseUri, workspace);
-    }
-
-
-    protected static URI getBaseUri() {
-        String baseUri = System.getProperty("chempound.uri");
-        if (baseUri == null) {
-            baseUri = System.getenv("CHEMPOUND_URI");
-            if (baseUri == null) {
-                throw new RuntimeException("Chempound base URI must be set.");
-            }
-        }
-        return URI.create(baseUri);
-    }
-
-    protected static File getWorkspace() {
-        String workspacePath = System.getProperty("chempound.workspace");
-        if (workspacePath == null) {
-            workspacePath = System.getenv("CHEMPOUND_WORKSPACE");
-            if (workspacePath == null) {
-                throw new RuntimeException("Chempound workspace path must be set.");
-            }
-        }
-        return new File(workspacePath);
-    }
-
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.