]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.procore.ui/src/org/simantics/db/procore/ui/Auxiliary.java
b05ff95d26071755a3ce6de610ef93074671ff7f
[simantics/platform.git] / bundles / org.simantics.db.procore.ui / src / org / simantics / db / procore / ui / Auxiliary.java
1 package org.simantics.db.procore.ui;
2
3 import java.io.File;
4
5 import org.eclipse.swt.widgets.Shell;
6 import org.simantics.db.exception.InternalException;
7 import org.simantics.db.procore.ui.internal.UI;
8
9 public class Auxiliary {
10     /**
11      * @param shell for the user interface.
12      * @param exception thrown from server.
13      * @return true if server can be started.
14      */
15     public static boolean beforeStart(Shell shell, File folder) throws InternalException {
16         boolean skipPurge = "true".equals(System.getProperty("org.simantics.db.procore.ui.skipPurge"));
17         if (skipPurge)
18             return true;
19         return UI.purge(shell, folder);
20     }
21     /**
22      * @param shell for the user interface.
23      * @param exception thrown from server start.
24      * @return true if problem with server start was successfully fixed.
25      */
26     public static boolean handleStart(Shell shell, InternalException exception) throws InternalException {
27         return UI.handleStart(shell, exception);
28     }
29     /**
30      * @param shell for the user interface.
31      * @param folder of the database.
32      * @return true if deletion was successful.
33      */
34     public static boolean delete(Shell shell, File folder) {
35         return UI.delete(shell, folder);
36     }
37     /**
38      * @param shell for the user interface.
39      * @param folder of the database.
40      * @return true if purge was successful.
41      */
42     public static boolean purge(Shell shell, File folder) {
43         return UI.purge(shell, folder);
44     }
45 }