AntXtras/Svn4Ant-1.1.0

com.idaremedia.svn4ant.helpers
Class SvnUtils

java.lang.Object
  extended bycom.idaremedia.svn4ant.helpers.Utils
      extended bycom.idaremedia.svn4ant.helpers.SvnUtils

public final class SvnUtils
extends Utils

Common utility function for dealing with some SVNKit classes.

Since:
JWare/Svn4Ant 0.1
Author:
ssmc, ©2005-2007 iDare Media, Inc.
Thread Safety:
single

Method Summary
static SVNURL copy(SVNURL url)
          Tries to return an independent copy of the given repository url.
static SVNURL getAdjustedUrlOrFail(String urlstring, SVNException origX, com.idaremedia.antx.apis.Requester clnt)
          Tries to rework the incoming urlstring to something valid.
static void quietlyClose(SVNWCAccess wcAccessor)
          Quietly closes a set of wc administrators.
static String splitrevision(String inputstring, com.idaremedia.antx.helpers.ObjectHandle outstring)
          Utility to extract embedded revision information from an incoming path or url location.
static boolean tickle(File wc)
          Hack the local subversion entries file to say the preceding checkout or update was incomplete.
static String[] toExportableStrings(SVNExternalInfo e)
          Create strings of an external's definitions (at most two).
static String token(org.tmatesoft.svn.cli.SVNArgument arg)
          Returns the most descriptive argument name for the given SVN subcommand.
 
Methods inherited from class com.idaremedia.svn4ant.helpers.Utils
closeQuiety, deleteDirectory, getDefaultExcludesFor, getIncludedPaths, getIncludedPaths, initTaskFor, invokePrecommitHook, maybeDelete, message, newrefid, scrubDirectory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

token

public static final String token(org.tmatesoft.svn.cli.SVNArgument arg)
Returns the most descriptive argument name for the given SVN subcommand.

Parameters:
arg - the subcommand (non-null)
Returns:
the long name of command if possible else first short name.

copy

public static SVNURL copy(SVNURL url)
Tries to return an independent copy of the given repository url. Will return null if incoming url is null.

Parameters:
url - the incoming url
Returns:
copy of url (as per encoded path)
Throws:
com.idaremedia.antx.apis.BuildError - if unable to copy a valid SVNURL for any reason.

splitrevision

public static String splitrevision(String inputstring,
                                   com.idaremedia.antx.helpers.ObjectHandle outstring)
Utility to extract embedded revision information from an incoming path or url location. Currently only works for urls and paths that can have a peg revision appended at end.

Parameters:
inputstring - incoming field value string (non-null)
outstring - holder for updated field value (without revision)
Returns:
revision string or null if none.

tickle

public static boolean tickle(File wc)
Hack the local subversion entries file to say the preceding checkout or update was incomplete. This forces a previous -N checkout or update to be converted to recursive. This is an attempt to do something convenient that other clients don't seem to do. If we fail, no big; just continue with update as if nothing occured.

Parameters:
wc - working copy file (non-null)

quietlyClose

public static void quietlyClose(SVNWCAccess wcAccessor)
Quietly closes a set of wc administrators. Any close errors are ignored.

Parameters:
wcAccessor - top-level holder o' admin references.
Since:
JWare/Svn4Ant 1.1

toExportableStrings

public static String[] toExportableStrings(SVNExternalInfo e)
Create strings of an external's definitions (at most two). Will return a string array of two (2) if definition has been modified; otherwise always returns the old (up-to-date) definition strings.

Parameters:
e - the external definition (non-null)
Returns:
strings for external definitions (suitable for saving to property)
Since:
JWare/Svn4Ant 1.1

getAdjustedUrlOrFail

public static SVNURL getAdjustedUrlOrFail(String urlstring,
                                          SVNException origX,
                                          com.idaremedia.antx.apis.Requester clnt)
                                   throws SVNException
Tries to rework the incoming urlstring to something valid. On Windoze the file URLs are not proper URLs (missing '://').

Parameters:
urlstring - original script-supplied url string
origX - original parsing error from script-supplied url string
Returns:
the svn url from adjusted url string (non-null)
Throws:
SVNException - if unable to adjust url string
Since:
JWare/Svn4Ant 1.1

AntXtras/Svn4Ant-1.1.0

Copyright (c) 2005-2008 Sandbox Software MC. All Rights Reserved.