org.tigris.subversion.svnclientadapter
Class SVNBaseDir

java.lang.Object
  extended by org.tigris.subversion.svnclientadapter.SVNBaseDir

public class SVNBaseDir
extends java.lang.Object

During notification (both with svn command line and javahl), the files and directories are sometimes relative (with svn commit for ex). However it is not relative to current directory but relative to the common parent of the current directory and the working copy target ex : if working copy is at /home/cedric/programmation/sources/test and current dir is /home/cedric/projects/subversion/subclipse $svn ci /home/cedric/programmation/sources/test/essai8 Adding programmation/sources/test/essai8

Author:
Cedric Chabanois (cchab at tigris.org), John M Flinchbaugh (john at hjsoft.com)

Constructor Summary
SVNBaseDir()
           
 
Method Summary
static java.io.File getBaseDir(java.io.File file)
          get the base directory for the given file
static java.io.File getBaseDir(java.io.File[] files)
          get the base directory for a set of files or null if there is no base directory for the set of files
protected static java.io.File getCommonPart(java.io.File file1, java.io.File file2)
          get the common directory between file1 and file2 or null if the files have nothing in common it always returns a directory unless file1 is the same file than file2
static java.lang.String getRelativePath(java.io.File rootDir, java.io.File file)
          get path of file relative to rootDir
static java.io.File getRootDir(java.io.File[] files)
          get the root directory for a set of files ie the ancestor of all given files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVNBaseDir

public SVNBaseDir()
Method Detail

getCommonPart

protected static java.io.File getCommonPart(java.io.File file1,
                                            java.io.File file2)
get the common directory between file1 and file2 or null if the files have nothing in common it always returns a directory unless file1 is the same file than file2

Parameters:
file1 -
file2 -

getBaseDir

public static java.io.File getBaseDir(java.io.File file)
get the base directory for the given file

Parameters:
file -
Returns:
the base directory for the given file or null if there is no base

getBaseDir

public static java.io.File getBaseDir(java.io.File[] files)
get the base directory for a set of files or null if there is no base directory for the set of files

Parameters:
files -
Returns:
the base directory for the given set of files or null if there is no base

getRootDir

public static java.io.File getRootDir(java.io.File[] files)
get the root directory for a set of files ie the ancestor of all given files

Parameters:
files -
Returns:
@throws SVNClientException

getRelativePath

public static java.lang.String getRelativePath(java.io.File rootDir,
                                               java.io.File file)
                                        throws SVNClientException
get path of file relative to rootDir

Parameters:
rootDir -
file -
Returns:
path of file relative to rootDir
Throws:
SVNClientException