001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.so6.core.exec;
034:
035: import org.libresource.so6.core.WsConnection;
036:
037: /**
038: * The <code>Restore</code> class is used to restore a corrupted connection
039: * <p>
040: * Parameter of that command
041: * <ul>
042: * <li>wscPath : Path of the connection property file (.so6/1/so6.properties)
043: * </li>
044: * </ul>
045: *
046: *
047: * @author Smack
048: * @version 1.0, 26/05/04
049: * @see org.libresource.so6.core.exec.Main
050: * @since JDK1.4
051: */
052: public class Restore {
053: private WsConnection ws;
054:
055: /**
056: * Instantiate the restore process
057: *
058: * @param wscPath :
059: * Path of the connection property file (.so6/1/so6.properties)
060: * @throws Exception
061: */
062: public Restore(String wscPath) throws Exception {
063: this .ws = new WsConnection(wscPath);
064: }
065:
066: /**
067: * Execute the restore process
068: *
069: * @throws Exception
070: */
071: public void execute() throws Exception {
072: ws.restore();
073: }
074:
075: /**
076: * Instantiate and execute the restore process.
077: * <p>
078: * Caution: Some corruptions need manually restoration afterward.
079: *
080: * @param args
081: * <ul>
082: * <li>wscPath : Path of the connection property file
083: * (.so6/1/so6.properties)</li>
084: * </ul>
085: * @throws Exception
086: */
087: public static void main(String[] args) throws Exception {
088: if (args.length != 1) {
089: System.err.println("Usage: wscPath");
090: System.err.println(" (1) wscPath: path of the file "
091: + WsConnection.SO6_WSC_FILE);
092: } else {
093: String wsPath = args[0];
094: Restore restore = new Restore(wsPath);
095: restore.execute();
096:
097: //
098: System.out.println("\007");
099: System.exit(0);
100: }
101: }
102: }
|