Index: lutinutil/src/java/org/codelutin/vcs/VCSConfig.java diff -u lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.2 lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.3 --- lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.2 Tue Jan 8 01:21:24 2008 +++ lutinutil/src/java/org/codelutin/vcs/VCSConfig.java Sun Mar 2 10:08:09 2008 @@ -26,6 +26,22 @@ * @author chemit */ public interface VCSConfig { + + /** + * find out if a connection to remote vcs servsder can be etablished. + *

+ * Note : The method is safe and will not throw any exception. + * + * @return true if connection to remote vcs server can be + * etablished. + */ + boolean canConnect(); + + /** @return true if handler is connected to remote vcs server */ + boolean isConnected(); + + ConnectionState getConnectionState(); + VCSType getType(); boolean isUseSshConnexion(); Index: lutinutil/src/java/org/codelutin/vcs/VCSHandler.java diff -u lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.1 lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.2 --- lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.1 Fri Jan 4 09:58:51 2008 +++ lutinutil/src/java/org/codelutin/vcs/VCSHandler.java Sun Mar 2 10:08:09 2008 @@ -33,7 +33,12 @@ */ public interface VCSHandler { - + + /** + * TODO renommer en workingCopyRootFile + * + * @return + */ File getLocalDatabaseFile(); /** @@ -206,8 +211,7 @@ * * @param directory directory to treate * @return TODO - * @throws VCSException - * TODO + * @throws VCSException TODO */ List getRemoteStorageNames(File directory) throws VCSException; Index: lutinutil/src/java/org/codelutin/vcs/VCSHelper.java diff -u lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.1 lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.2 --- lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.1 Fri Jan 4 09:58:51 2008 +++ lutinutil/src/java/org/codelutin/vcs/VCSHelper.java Sun Mar 2 10:08:09 2008 @@ -205,6 +205,10 @@ return result; } + public static boolean isConnected() { + return VCSHandlerFactory.getConfig().isConnected(); + } + public static boolean hasWriteAccess() { return !VCSHandlerFactory.getConfig().isReadOnly(); } Index: lutinutil/src/java/org/codelutin/vcs/ConnectionState.java diff -u /dev/null lutinutil/src/java/org/codelutin/vcs/ConnectionState.java:1.1 --- /dev/null Sun Mar 2 10:08:16 2008 +++ lutinutil/src/java/org/codelutin/vcs/ConnectionState.java Sun Mar 2 10:08:09 2008 @@ -0,0 +1,35 @@ +/* +* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* \#\#% */ +package org.codelutin.vcs; + +/** + * Une enumeration pour definir l'état du connexion à un serveur vcs. + * + * @author chemit + */ +public enum ConnectionState { + /** lorsque la connexion n'a pas encore initialisée */ + UNDEFINED, + /** lorsque la connexion est ok, mais que l'on est pas connecté */ + OFF_LINE, + /** lorsque la connexion est établie avec succes */ + ON_LINE, + /** lorsque la connexion a tentée de s'initialiser sans succes */ + ERROR +}