Index: lutinutil/src/java/org/codelutin/vcs/VCSConfig.java
diff -u lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.3 lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.4
--- lutinutil/src/java/org/codelutin/vcs/VCSConfig.java:1.3 Sun Mar 2 10:08:09 2008
+++ lutinutil/src/java/org/codelutin/vcs/VCSConfig.java Sun Mar 30 00:15:24 2008
@@ -40,43 +40,58 @@
/** @return true if handler is connected to remote vcs server */
boolean isConnected();
+ /** @return the current connexion state */
ConnectionState getConnectionState();
+ /** @return the type of vcs used */
VCSType getType();
+ /** @return true if ssh connexion is used */
boolean isUseSshConnexion();
+ /** @return the url of hostname */
String getHostName();
+ /** @return location of the private ssh2 key file */
File getKeyFile();
+ /** @return the user connexion login */
String getUserName();
+ /** @return true if user ssh2 pair keys use a passphrase */
boolean isNoPassPhrase();
//char[] getPassphrase();
+ /** @return the full location path of the remote container of module */
String getRemotePath();
+ /** @return the name of remote module */
String getRemoteDatabase();
+ /** @return the full url path to the remote repository (with module name include) */
String getRemoteDatabasePath();
- File getLocalPath();
+ //String getLocalDatabase();
- String getLocalDatabase();
-
- File getLocalDatabaseFile();
+ File getLocalDatabasePath();
+ /** @return the type of reposotory used (head,tags,branches,...) */
VCSTypeRepo getTypeRepo();
Class extends VCSHandler> getHandlerClass();
+ /** @return true if no connexion is etablish at current time */
boolean isOffline();
+ /** @return true if remote repository is read-only */
+
boolean isReadOnly();
+ /** @return true if vcs handler is finely init */
+
boolean isInit();
+ /** method to validate vcs configuration. */
void validate();
}
Index: lutinutil/src/java/org/codelutin/vcs/VCSHandler.java
diff -u lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.2 lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.3
--- lutinutil/src/java/org/codelutin/vcs/VCSHandler.java:1.2 Sun Mar 2 10:08:09 2008
+++ lutinutil/src/java/org/codelutin/vcs/VCSHandler.java Sun Mar 30 00:15:24 2008
@@ -39,7 +39,7 @@
*
* @return
*/
- File getLocalDatabaseFile();
+ File getLocalDatabasePath();
/**
* init working copy, says if it is the first we use it it, we will checkout
Index: lutinutil/src/java/org/codelutin/vcs/VCSFileState.java
diff -u lutinutil/src/java/org/codelutin/vcs/VCSFileState.java:1.1 lutinutil/src/java/org/codelutin/vcs/VCSFileState.java:1.2
--- lutinutil/src/java/org/codelutin/vcs/VCSFileState.java:1.1 Fri Jan 4 09:58:51 2008
+++ lutinutil/src/java/org/codelutin/vcs/VCSFileState.java Sun Mar 30 00:15:24 2008
@@ -1,12 +1,5 @@
package org.codelutin.vcs;
-import org.codelutin.vcs.VCSAction;
-import org.codelutin.vcs.VCSException;
-import org.codelutin.vcs.VCSRuntimeException;
-import org.codelutin.vcs.VCSHelper;
-import org.codelutin.vcs.VCSState;
-import org.codelutin.vcs.VCSHandler;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -84,13 +77,13 @@
this.file = file;
this.key = file.getAbsolutePath().hashCode();
String path = file.getAbsolutePath();
- String rootPath = handler.getLocalDatabaseFile().getAbsolutePath();
+ String rootPath = handler.getLocalDatabasePath().getAbsolutePath();
if (!path.startsWith(rootPath)) {
throw new VCSRuntimeException("could not create a VCSFileState " +
"for a file not in the root working copy registered in " +
"vcsHandler, but was : [" + file + " ::" +
- handler.getLocalDatabaseFile() + " ]");
+ handler.getLocalDatabasePath() + " ]");
}
this.localPath = path.substring(rootPath.length() + 1);
// by default moduleName is the first dir of localpath (if any)
Index: lutinutil/src/java/org/codelutin/vcs/VCSHelper.java
diff -u lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.3 lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.4
--- lutinutil/src/java/org/codelutin/vcs/VCSHelper.java:1.3 Tue Mar 18 18:18:36 2008
+++ lutinutil/src/java/org/codelutin/vcs/VCSHelper.java Sun Mar 30 00:15:24 2008
@@ -53,7 +53,7 @@
throw new RuntimeException(VCSHelper.class.getName() +
"#isFileInWorkingCopy can not be invoked with some " +
"null parameter but was. [" + file + "," + handler + "]");
- String rootPath = VCSHandlerFactory.getConfig().getLocalDatabaseFile().getAbsolutePath();
+ String rootPath = VCSHandlerFactory.getConfig().getLocalDatabasePath().getAbsolutePath();
String localPath = file.getAbsolutePath();
if (localPath.startsWith(rootPath) && !underVCS) {
return true;
@@ -76,13 +76,13 @@
if (!isFileInWorkingCopy(file, handler, false))
throw new VCSRuntimeException("the file [" + file +
"] is not in the working copy [" +
- handler.getLocalDatabaseFile() + "]");
+ handler.getLocalDatabasePath() + "]");
}
public static String getRemoteRelativePath(File f, VCSHandler handler) {
if (!isFileInWorkingCopy(f, handler, false)) return null;
//System.out.println("file on vcs working copy : "+f);
- String rootPath = handler.getConfig().getLocalDatabaseFile().getAbsolutePath();
+ String rootPath = handler.getConfig().getLocalDatabasePath().getAbsolutePath();
String localPath = f.getAbsolutePath();
if (!localPath.startsWith(rootPath)) return null;
localPath = localPath.substring(rootPath.length() + 1);
@@ -91,7 +91,7 @@
public static String getLocalRelativePath(String remoteRelativePath, VCSHandler handler) {
String localPath = convertToLocalName(remoteRelativePath);
- final File file = new File(handler.getConfig().getLocalDatabaseFile(), localPath);
+ final File file = new File(handler.getConfig().getLocalDatabasePath(), localPath);
if (!isFileInWorkingCopy(file, handler, false)) return null;
return localPath;
}
Index: lutinutil/src/java/org/codelutin/vcs/AbstractVCSHandler.java
diff -u lutinutil/src/java/org/codelutin/vcs/AbstractVCSHandler.java:1.1 lutinutil/src/java/org/codelutin/vcs/AbstractVCSHandler.java:1.2
--- lutinutil/src/java/org/codelutin/vcs/AbstractVCSHandler.java:1.1 Fri Jan 4 09:58:51 2008
+++ lutinutil/src/java/org/codelutin/vcs/AbstractVCSHandler.java Sun Mar 30 00:15:24 2008
@@ -71,14 +71,14 @@
return config;
}
- public File getLocalDatabaseFile() {
- return config.getLocalDatabaseFile();
+ public File getLocalDatabasePath() {
+ return config.getLocalDatabasePath();
}
public void deleteWorkingCopy() {
- if (getLocalDatabaseFile().exists()) {
- FileUtil.deleteRecursively(getLocalDatabaseFile());
- getLocalDatabaseFile().delete();
+ if (getLocalDatabasePath().exists()) {
+ FileUtil.deleteRecursively(getLocalDatabasePath());
+ getLocalDatabasePath().delete();
}
}