org.tmatesoft.svn.core.wc2

## Class SvnUpdate

- java.lang.Object
- - org.tmatesoft.svn.core.wc2.SvnOperation<V>
  - - org.tmatesoft.svn.core.wc2.AbstractSvnUpdate<long[]>
    - - org.tmatesoft.svn.core.wc2.SvnUpdate

- All Implemented Interfaces:
    ISvnOperationOptionsProvider

      public class SvnUpdate
      extends AbstractSvnUpdate<long[]>

  Represents update operation. Updates working copy to `revision`. If no revision is given, it brings working copy up-to-date with `SVNRevision.HEAD` revision. Unversioned paths that are direct children of a versioned path will cause an update that attempts to add that path, other unversioned paths are skipped.

  The `targets` can be from multiple working copies from multiple repositories, but even if they all come from the same repository there is no guarantee that revision represented by `SVNRevision.HEAD` will remain the same as each path is updated.

  If externals are ignored (`ignoreExternals` is `true`), doesn't process externals definitions as part of this operation.

  If `depth` is `SVNDepth.INFINITY`, updates fully recursively. Else if it is `SVNDepth.IMMEDIATES` or `SVNDepth.FILES`, updates each `target` and its file entries, but not its subdirectories. Else if `SVNDepth.EMPTY`, updates exactly each target, nonrecursively (essentially, updates the target's properties).

  If `depth` is `SVNDepth.UNKNOWN`, takes the working depth from `paths` and then behaves as described above.

  If `depthIsSticky` is set and `depth` is not `SVNDepth.UNKNOWN`, then in addition to updating `paths` , also sets their sticky ambient depth value to `depth`.

  If `allowUnversionedObstructions` is `true` then the update tolerates existing unversioned items that obstruct added paths. Only obstructions of the same type (file or directory) as the added item are tolerated. The text of obstructing files is left as-is, effectively treating it as a user modification after the update. Working properties of obstructing items are set equal to the base properties. If `allowUnversionedObstructions` is `false` then the update will abort if there are any unversioned obstructing items.

  If the operation's `ISVNEventHandler` is non-`null`, it is invoked for each item handled by the update, and also for files restored from text-base. Also `ISVNCanceller.checkCancelled()` will be used at various places during the update to check whether the caller wants to stop the update.

  This operation requires repository access (in case the repository is not on the same machine, network connection is established).

  `SvnOperation.run()` method returns an array of `long` revisions with each element set to the revision to which `revision` was resolved. `SvnOperation.run()` throws `SVNException` in the following cases:
  exception with `SVNErrorCode.ILLEGAL_TARGET` error code - if `target` is not a local path
  exception with `SVNErrorCode.RA_ILLEGAL_URL` error code - if external item at the `revision` doesn't exist, or if external item at the `revision` is not file or a directory
  exception with `SVNErrorCode.ENTRY_MISSING_URL` error code - if working copy item that has no URL
  Version:
    1.7
  Author:
    TMate Software Ltd.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SvnUpdate(SvnOperationFactory factory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `ensureArgumentsAreValid()`
    `protected int` | `getMaximumTargetsCount()`
    `boolean` | `isChangesWorkingCopy()` Gets whether the operation changes working copy
    `boolean` | `isDepthIsSticky()` Gets whether or not the requested depth should be written to the working copy.
    `boolean` | `isMakeParents()` Gets whether or not intermediate directories should be made.
    `boolean` | `isTreatAddsAsModifications()` Gets whether or not adds should be treated as modifications.
    `void` | `setDepthIsSticky(boolean depthIsSticky)` Sets whether or not the requested depth should be written to the working copy.
    `void` | `setMakeParents(boolean makeParents)` Sets whether or not intermediate directories should be made.
    `void` | `setTreatAddsAsModifications(boolean treatAddsAsModifications)` Sets whether or not adds should be treated as modifications.

    - ### Methods inherited from class org.tmatesoft.svn.core.wc2.AbstractSvnUpdate

      `getExternalsHandler, isAllowUnversionedObstructions, isIgnoreExternals, isUpdateLocksOnDemand, setAllowUnversionedObstructions, setExternalsHandler, setIgnoreExternals, setUpdateLocksOnDemand`

    - ### Methods inherited from class org.tmatesoft.svn.core.wc2.SvnOperation

      `addTarget, cancel, ensureEnoughTargets, ensureHomohenousTargets, getApplicableChangelists, getAuthenticationManager, getCanceller, getDepth, getEventHandler, getFirstTarget, getMinimumTargetsCount, getOperationalWorkingCopy, getOperationFactory, getOptions, getRepositoryPool, getRevision, getSqliteJournalMode, getTargets, hasFileTargets, hasLocalTargets, hasRemoteTargets, initDefaults, isCancelled, isSleepForTimestamp, isUseParentWcFormat, needsHomohenousTargets, run, setApplicalbeChangelists, setDepth, setRevision, setSingleTarget, setSleepForTimestamp, setSqliteJournalMode`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SvnUpdate

          protected SvnUpdate(SvnOperationFactory factory)

  - ### Method Detail

    - #### ensureArgumentsAreValid

          protected void ensureArgumentsAreValid()
                                          throws SVNException

      Overrides:
        `ensureArgumentsAreValid` in class `SvnOperation<long[]>`
      Throws:
        `SVNException`

    - #### isDepthIsSticky

          public boolean isDepthIsSticky()

      Gets whether or not the requested depth should be written to the working copy.
      Returns:
        `true` if the requested depth should be written to the working copy, otherwise `false`

    - #### setDepthIsSticky

          public void setDepthIsSticky(boolean depthIsSticky)

      Sets whether or not the requested depth should be written to the working copy.
      Parameters:
        `depthIsSticky` - `true` if the requested depth should be written to the working copy, otherwise `false`

    - #### isMakeParents

          public boolean isMakeParents()

      Gets whether or not intermediate directories should be made.
      Returns:
        `true` if intermediate directories should be made, otherwise `false`

    - #### setMakeParents

          public void setMakeParents(boolean makeParents)

      Sets whether or not intermediate directories should be made.
      Parameters:
        `makeParents` - `true` if intermediate directories should be made, otherwise `false`

    - #### isTreatAddsAsModifications

          public boolean isTreatAddsAsModifications()

      Gets whether or not adds should be treated as modifications.
      Returns:
        `true` if adds should be treated as modifications, otherwise `false`

    - #### setTreatAddsAsModifications

          public void setTreatAddsAsModifications(boolean treatAddsAsModifications)

      Sets whether or not adds should be treated as modifications.
      Parameters:
        `treatAddsAsModifications` - `true` if adds should be treated as modifications, otherwise `false`

    - #### getMaximumTargetsCount

          protected int getMaximumTargetsCount()

      Overrides:
        `getMaximumTargetsCount` in class `SvnOperation<long[]>`

    - #### isChangesWorkingCopy

          public boolean isChangesWorkingCopy()

      Gets whether the operation changes working copy
      Overrides:
        `isChangesWorkingCopy` in class `SvnOperation<long[]>`
      Returns:
        `true` if the operation changes the working copy, otherwise `false`