Class SvnTarget

java.lang.Object
org.tmatesoft.svn.core.wc2.SvnTarget

public class SvnTarget extends java.lang.Object
Represents target of the operation on whose operation will be executed. Can specify working copy path or repository URL.
Version:
1.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private java.io.File
     
    private SVNRevision
     
    private SVNURL
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    SvnTarget(java.io.File file, SVNRevision pegRevision)
     
    private
    SvnTarget(SVNURL url, SVNRevision pegRevision)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static SvnTarget
    fromFile(java.io.File file)
    Creates a target from file
    static SvnTarget
    fromFile(java.io.File file, SVNRevision pegRevision)
    Creates a target from file and its peg revision
    static SvnTarget
    Creates a target from URL
    static SvnTarget
    fromURL(SVNURL url, SVNRevision pegRevision)
    Creates a target from URL and its peg revision
    private SVNURL
     
    java.io.File
    Returns target's file, if target is not file returns null.
    java.lang.String
    Determines whether target is remote or local, and returns corresponding String representation of the target's path
    java.lang.String
    Determines whether target is remote or local, and returns corresponding String representation of the target's path
    Returns target's peg revision, if it was not defined returns null.
    Calls getResolvedPegRevision with SVNRevision.HEAD, SVNRevision.WORKING as default values
    getResolvedPegRevision(SVNRevision defaultRemote, SVNRevision defaultLocal)
    Returns target's peg revision if defined, if not defined determines whether target is remote or local, and returns corresponding default revision
    Returns target's URL, if target is not URL returns null.
    boolean
    Determines whether target represents file
    boolean
    Determines whether target is located in the local working copy and its peg revision is working copy specific.
    boolean
    Determines whether target represents URL
    private void
     
    java.lang.String
    Determines whether target is remote or local, and returns corresponding String representation of the target's path and peg revision.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • url

      private SVNURL url
    • file

      private java.io.File file
    • pegRevision

      private SVNRevision pegRevision
  • Constructor Details

    • SvnTarget

      private SvnTarget(java.io.File file, SVNRevision pegRevision)
    • SvnTarget

      private SvnTarget(SVNURL url, SVNRevision pegRevision)
  • Method Details

    • fromFile

      public static SvnTarget fromFile(java.io.File file)
      Creates a target from file
      Parameters:
      file - target file
      Returns:
      a new SvnTarget object representing the file
    • fromFile

      public static SvnTarget fromFile(java.io.File file, SVNRevision pegRevision)
      Creates a target from file and its peg revision
      Parameters:
      file - target file
      pegRevision - revision in which the file item is first looked up
      Returns:
      a new SvnTarget object representing the file with revisition
    • fromURL

      public static SvnTarget fromURL(SVNURL url)
      Creates a target from URL
      Parameters:
      url - target URL
      Returns:
      a new SvnTarget object representing URL
    • fromURL

      public static SvnTarget fromURL(SVNURL url, SVNRevision pegRevision)
      Creates a target from URL and its peg revision
      Parameters:
      url - target URL
      pegRevision - revision in which the file item is first looked up
      Returns:
      a new SvnTarget object representing URL with revisition
    • getCanonicalUrl

      private SVNURL getCanonicalUrl(SVNURL url)
    • isLocal

      public boolean isLocal()
      Determines whether target is located in the local working copy and its peg revision is working copy specific.
      Returns:
      true if the target and its peg revision refers to local working copy, otherwise false
    • isFile

      public boolean isFile()
      Determines whether target represents file
      Returns:
      true if the target is file, otherwise false
    • isURL

      public boolean isURL()
      Determines whether target represents URL
      Returns:
      true if the target is URL, otherwise false
    • getURL

      public SVNURL getURL()
      Returns target's URL, if target is not URL returns null.
      Returns:
      url of the target
    • getFile

      public java.io.File getFile()
      Returns target's file, if target is not file returns null.
      Returns:
      url of the target
    • getPegRevision

      public SVNRevision getPegRevision()
      Returns target's peg revision, if it was not defined returns null.
      Returns:
      peg revision of the target
    • getResolvedPegRevision

      public SVNRevision getResolvedPegRevision()
      Calls getResolvedPegRevision with SVNRevision.HEAD, SVNRevision.WORKING as default values
      Returns:
      peg revision of the target
      See Also:
    • getResolvedPegRevision

      public SVNRevision getResolvedPegRevision(SVNRevision defaultRemote, SVNRevision defaultLocal)
      Returns target's peg revision if defined, if not defined determines whether target is remote or local, and returns corresponding default revision
      Parameters:
      defaultRemote - default revision if target is remote target
      defaultLocal - default revision if target is local target
      Returns:
      peg revision of the target
    • setPegRevision

      private void setPegRevision(SVNRevision revision)
    • getPathOrUrlString

      public java.lang.String getPathOrUrlString()
      Determines whether target is remote or local, and returns corresponding String representation of the target's path
      Returns:
      String representation of the target's path
    • getPathOrUrlDecodedString

      public java.lang.String getPathOrUrlDecodedString()
      Determines whether target is remote or local, and returns corresponding String representation of the target's path
      Returns:
      String representation of the target
    • toString

      public java.lang.String toString()
      Determines whether target is remote or local, and returns corresponding String representation of the target's path and peg revision.
      Overrides:
      toString in class java.lang.Object
      Returns:
      String of the target's path and peg revision