fr.ifremer.isisfish.vcs
Class AbstractVCS

java.lang.Object
  extended by fr.ifremer.isisfish.vcs.AbstractVCS
All Implemented Interfaces:
VCS, FileFilter
Direct Known Subclasses:
VCSNone, VCSSVN

public abstract class AbstractVCS
extends Object
implements VCS

Abstract VCS implementation.

Version:
$Revision: 1.0 $ Last update : $Date: 1 déc. 2008 $ By : $Author: chatellier $
Author:
poussin

Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.ifremer.isisfish.vcs.VCS
VCS.Status
 
Field Summary
protected  String host
           
protected  Set<VetoableActionListener> listeners
           
protected  File localRepository
           
protected  String login
           
protected  String password
           
protected  String path
           
protected  String protocol
           
protected  File sshKeyFile
           
protected  boolean writeable
           
 
Fields inherited from interface fr.ifremer.isisfish.vcs.VCS
TYPE_CVS, TYPE_NONE, TYPE_SVN, VCS_HOST_NAME, VCS_PATH, VCS_PROTOCOL, VCS_TYPE, VCS_USER_NAME, VCS_USER_PASSWORD
 
Constructor Summary
AbstractVCS(File localRepository, String protocol, String host, String path, File sshKeyFile, String login, String password)
           
 
Method Summary
 boolean accept(File pathname)
           
 void addVetoableActionListener(VetoableActionListener l)
          Ajout un listener pouvant interdire les actions du vcs
protected  boolean fireAction(VCSActionEvent e, File... files)
           
 String getHost()
          Get host.
 File getLocalRepository()
          Get local repository directory
 String getLogin()
          Get login.
 String getPassword()
          Get password.
 String getPath()
          Get repository path.
 String getProtocol()
          Get protocol.
 File getSshKeyFile()
          Get ssh key file.
 boolean isVersionnableFile(File file)
          Check if file can be put in vcs repository.
 void remoteVetoableActionListener(VetoableActionListener l)
          Supprime un listener pouvant interdire les actions du vcs
 void setHost(String host)
          checkProtocol is automatically done
 void setLocalRepository(File localRepository)
           
 void setLogin(String login)
          checkProtocol is automatically done
 void setPassword(String password)
          Change password.
 void setPath(String path)
          checkProtocol is automatically done
 void setProtocol(String protocol)
          checkProtocol is automatically done
 void setSshKeyFile(File sshKeyFile)
          Change ssk key file to use.
 void setWriteable(boolean value)
          Permit to force repository to read-only if value is false, otherwise use normal rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.ifremer.isisfish.vcs.VCS
add, checkFileStatus, checkout, checkProtocol, cleanup, commit, delete, getChanglog, getDiff, getFileList, getLocalStatus, getTag, getUpdatedFile, haveUpdate, isConnected, isOnRemote, isTag, isUpToDate, isValidLocalRepository, isWriteable, setTag, update
 

Field Detail

listeners

protected Set<VetoableActionListener> listeners

localRepository

protected File localRepository

protocol

protected String protocol

host

protected String host

path

protected String path

sshKeyFile

protected File sshKeyFile

login

protected String login

password

protected String password

writeable

protected boolean writeable
Constructor Detail

AbstractVCS

public AbstractVCS(File localRepository,
                   String protocol,
                   String host,
                   String path,
                   File sshKeyFile,
                   String login,
                   String password)
Method Detail

addVetoableActionListener

public void addVetoableActionListener(VetoableActionListener l)
Description copied from interface: VCS
Ajout un listener pouvant interdire les actions du vcs

Specified by:
addVetoableActionListener in interface VCS
Parameters:
l - listener to add

remoteVetoableActionListener

public void remoteVetoableActionListener(VetoableActionListener l)
Description copied from interface: VCS
Supprime un listener pouvant interdire les actions du vcs

Specified by:
remoteVetoableActionListener in interface VCS
Parameters:
l - listener to remove

setWriteable

public void setWriteable(boolean value)
Description copied from interface: VCS
Permit to force repository to read-only if value is false, otherwise use normal rules.

Specified by:
setWriteable in interface VCS
Parameters:
value - writable

fireAction

protected boolean fireAction(VCSActionEvent e,
                             File... files)

getLocalRepository

public File getLocalRepository()
Description copied from interface: VCS
Get local repository directory

Specified by:
getLocalRepository in interface VCS
Returns:
local repository

setLocalRepository

public void setLocalRepository(File localRepository)

getProtocol

public String getProtocol()
Description copied from interface: VCS
Get protocol.

Specified by:
getProtocol in interface VCS
Returns:
protocol

setProtocol

public void setProtocol(String protocol)
                 throws VCSException
checkProtocol is automatically done

Specified by:
setProtocol in interface VCS
Parameters:
protocol -
Throws:
VCSException

getHost

public String getHost()
Description copied from interface: VCS
Get host.

Specified by:
getHost in interface VCS
Returns:
host

setHost

public void setHost(String host)
             throws VCSException
checkProtocol is automatically done

Specified by:
setHost in interface VCS
Parameters:
host -
Throws:
VCSException

getPath

public String getPath()
Description copied from interface: VCS
Get repository path.

Specified by:
getPath in interface VCS
Returns:
path

setPath

public void setPath(String path)
             throws VCSException
checkProtocol is automatically done

Specified by:
setPath in interface VCS
Parameters:
path -
Throws:
VCSException

getSshKeyFile

public File getSshKeyFile()
Description copied from interface: VCS
Get ssh key file.

Specified by:
getSshKeyFile in interface VCS
Returns:
ssh key file

setSshKeyFile

public void setSshKeyFile(File sshKeyFile)
Description copied from interface: VCS
Change ssk key file to use.

Specified by:
setSshKeyFile in interface VCS
Parameters:
sshKeyFile - new ssh kay file

getLogin

public String getLogin()
Description copied from interface: VCS
Get login.

Specified by:
getLogin in interface VCS
Returns:
login

setLogin

public void setLogin(String login)
              throws VCSException
checkProtocol is automatically done

Specified by:
setLogin in interface VCS
Parameters:
login -
Throws:
VCSException

getPassword

public String getPassword()
Description copied from interface: VCS
Get password.

Specified by:
getPassword in interface VCS
Returns:
password

setPassword

public void setPassword(String password)
Description copied from interface: VCS
Change password.

Specified by:
setPassword in interface VCS
Parameters:
password - password

accept

public boolean accept(File pathname)
Specified by:
accept in interface FileFilter

isVersionnableFile

public boolean isVersionnableFile(File file)
Description copied from interface: VCS
Check if file can be put in vcs repository. For example when you used CVS, you must not put CVS file.

default refused .svn, CVS and ~ filename Must be override, this default implementation return true.

Specified by:
isVersionnableFile in interface VCS
Returns:
true if file is versionnable


Copyright © 1999-2011 CodeLutin. All Rights Reserved.