01: /**
02: * LibreSource
03: * Copyright (C) 2004-2008 Artenum SARL / INRIA
04: * http://www.libresource.org - contact@artenum.com
05: *
06: * This file is part of the LibreSource software,
07: * which can be used and distributed under license conditions.
08: * The license conditions are provided in the LICENSE.TXT file
09: * at the root path of the packaging that enclose this file.
10: * More information can be found at
11: * - http://dev.libresource.org/home/license
12: *
13: * Initial authors :
14: *
15: * Guillaume Bort / INRIA
16: * Francois Charoy / Universite Nancy 2
17: * Julien Forest / Artenum
18: * Claude Godart / Universite Henry Poincare
19: * Florent Jouille / INRIA
20: * Sebastien Jourdain / INRIA / Artenum
21: * Yves Lerumeur / Artenum
22: * Pascal Molli / Universite Henry Poincare
23: * Gerald Oster / INRIA
24: * Mariarosa Penzi / Artenum
25: * Gerard Sookahet / Artenum
26: * Raphael Tani / INRIA
27: *
28: * Contributors :
29: *
30: * Stephane Bagnier / Artenum
31: * Amadou Dia / Artenum-IUP Blois
32: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33: */package org.libresource.so6.core.exec;
34:
35: import org.libresource.so6.core.client.DummyClient;
36:
37: import java.io.File;
38:
39: /**
40: * @author smack
41: */
42: public class CreateDummyWorkspace {
43: private String path;
44: private String qPath;
45: private String wsName;
46:
47: public CreateDummyWorkspace(String basePath, String queuePath,
48: String wsName) {
49: this .path = basePath;
50: this .qPath = queuePath;
51: this .wsName = wsName;
52: }
53:
54: public void execute() throws Exception {
55: new CreateGenericWsConnection(path, wsName,
56: CreateGenericWsConnection.FS_CLIENT_NAME, "", "",
57: qPath, null).executeLocalCreation();
58: }
59:
60: public static void main(String[] args) throws Exception {
61: if (args.length != 3) {
62: System.err.println("Usage: path qPath wsName");
63: System.err.println(" (1) path: path to share");
64: System.err
65: .println(" (2) qPath: queue path of the dummy client");
66: System.err.println(" (3) wsName: workspace name");
67: } else {
68: File queueBasePath = new File(args[1]);
69: File patch = new File(queueBasePath, DummyClient.PATCHFILES);
70: File cmds = new File(queueBasePath, DummyClient.CMDS);
71: File attach = new File(queueBasePath, DummyClient.ATTACH);
72:
73: if (queueBasePath.exists() && patch.exists()
74: && cmds.exists() && attach.exists()) {
75: new CreateDummyWorkspace(args[0], args[1], args[2])
76: .execute();
77: } else {
78: System.err.println("Invalide queue path...");
79: }
80:
81: System.exit(0);
82: }
83: }
84: }
|