Salome HOME
Refactoring: configuration files are moved into Siman web project.
[tools/siman.git] / Workspace / Siman / src / Test.java
1
2 import org.splat.launcher.FileTransfer;
3 import org.splat.launcher.WindowsRegistry;
4
5
6 public class Test {
7
8
9 //  ==============================================================================================================================
10 //  Main
11 //  ==============================================================================================================================
12
13         public static void main(String[] args) {
14 //  --------------------------------------
15 //    String  url      = "http://localhost:8080/repository/2011/PLM110001/1.Study";
16       String  command  = args[0];
17 //    String  filename = args[1];
18
19           String  applikey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Applications\\"   + command;
20           String  key      = "";
21       String              module = WindowsRegistry.readValue(applikey + "\\shell\\open\\command ", key);
22       if (module == null) module = WindowsRegistry.readValue(applikey + "\\shell\\edit\\command ", key);
23       try {
24 //      FileTransfer.Download(url, filename, path);
25         String[] parse = module.split("/");       // Removing eventual options
26
27         Runtime.getRuntime().exec(parse[0]);
28 //      Runtime.getRuntime().exec(parse[0] + " \"" + path + "\\" + filename + "\"");
29       }
30       catch (Exception error) {
31         System.out.println("Unable to start " + module);
32      }
33     }
34 }