|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tmatesoft.svn.core.wc2.SvnOperation<java.lang.Void> org.tmatesoft.svn.core.wc2.SvnCopy
public class SvnCopy
Represents copy operation.
Copies each source in sources
to operation's target
representing working copy path,
or converts a disjoint working copy to a copied one,
or does virtual copy (see below).
disjoint
and virtual
are false
:
If multiple sources
are given, target
must be a
directory, and sources
will be copied as children of
directory.
Each src
in sources
must be files or
directories under version control, or URLs of a versioned item in the
repository. If sources
has multiple items, they must be all
repository URLs or all working copy paths.
The parent of target
must already exist.
If sources
has only one item, attempts to copy it to
target
. If failWhenDstExists
is false
and target
already exists,
attempts to copy the item as a child of target
. If
failWhenDstExists
is true
and target
already exists, throws an SVNException
with
the SVNErrorCode.FS_ALREADY_EXISTS
error code.
If sources
has multiple items, and
failWhenDstExists
is false
,
all sources
are copied as children of target
. If
any child of target
already exists with the same name any item
in sources
, throws an SVNException
with the
SVNErrorCode.FS_ALREADY_EXISTS
error code.
If sources
has multiple items, and
failWhenDstExists
is true
,
throws an SVNException
with the
SVNErrorCode.CLIENT_MULTIPLE_SOURCES_DISALLOWED
.
If the caller's ISVNEventHandler
is non-null
, invokes
it for each item added at the new location.
This method is just a variant of a local add operation, where
sources
are scheduled for addition as copies. No changes
will happen to the repository until a commit occurs. This scheduling can
be removed with SvnRevert
.
Note: this routine requires repository access only when sources are URLs.
disjoint
is true
:
Targets
represent the roots of the working copies located in another working copies.
This copy operation uses only sources
as operation's parameters.
Note: this routine does not require repository access. However if it's
performed on an old format working copy where repository root urls were
not written, the routine will connect to the repository to fetch the
repository root urls.
SvnOperation.run()
throws SVNException
in the following cases:
SVNErrorCode.UNSUPPORTED_FEATURE
error code - if target
is either not a
directory, or has no parent at all; if the current local
filesystem parent of target
is actually a
child of it in the repository
exception with
SVNErrorCode.ENTRY_EXISTS
error code - if
target
is not a disjoint working copy, i.e. there is
already a versioned item under the parent path of
target
; if target
is not in the
repository yet (has got a schedule for addition flag)
exception with SVNErrorCode.WC_INVALID_SCHEDULE
error
code - if target
is not from the same
repository as the parent directory; if the parent of
target
is scheduled for deletion; if target
is scheduled for deletion
virtual
is true
:
Copies/moves administrative version control information of a source files
to administrative information of a destination file. For example, if you
have manually copied/moved a source files to a target
one (manually means
just in the filesystem, not using version control operations) and then
would like to turn this copying/moving into a complete version control
copy or move operation, use this method that will finish all the work for
you - it will copy/move all the necessary administrative information
(kept in the source .svn directory) to the target
.svn
directory.
In that case when you have your files copied/moved in the filesystem, you
can not perform standard (version control) copying/moving - since the
target
already exists and the source may be already deleted. Use this
method to overcome that restriction.
sources
and move
parameters.
If move
is true
then completes moving
src
to target
, otherwise completes copying src
to dst
SvnOperation.run()
throws SVNException
if one of the following is true:
move = true
and src
still exists target
does
not exist target
is a directory src
is a directory src
is not under
version control target
is already under version
control src
is copied but not scheduled
for addition, and SVNKit is not able to locate the copied
directory root for src
SvnCopySource
Constructor Summary | |
---|---|
protected |
SvnCopy(SvnOperationFactory factory)
|
Method Summary | |
---|---|
void |
addCopySource(SvnCopySource source)
Adds copy source information to the operation |
java.util.Collection<SvnCopySource> |
getSources()
Returns operation's all copy sources, object containing information about what to copy. |
boolean |
isChangesWorkingCopy()
Gets whether the operation changes working copy |
boolean |
isDisjoint()
Returns whether copy is disjoint working copy. |
boolean |
isFailWhenDstExists()
Gets whether to fail if target already exists. |
boolean |
isIgnoreExternals()
Returns whether to ignore externals definitions. |
boolean |
isMakeParents()
Gets whether to make parent folders if don't exist. |
boolean |
isMove()
Gets whether to do copy as move operation (delete, then add with history). |
boolean |
isVirtual()
Returns whether copy is virtual copy. |
void |
setDisjoint(boolean disjoint)
Sets whether copy is disjoint working copy. |
void |
setFailWhenDstExists(boolean isFailWhenDstExist)
Sets whether to fail if target already exists. |
void |
setIgnoreExternals(boolean ignoreExternals)
Sets whether to ignore externals definitions. |
void |
setMakeParents(boolean isMakeParents)
Sets whether to make parent folders if don't exist. |
void |
setMove(boolean isMove)
Sets whether to do copy as move operation (delete, then add with history). |
void |
setVirtual(boolean virtual)
Sets whether copy is virtual copy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected SvnCopy(SvnOperationFactory factory)
Method Detail |
---|
public java.util.Collection<SvnCopySource> getSources()
public void addCopySource(SvnCopySource source)
source
- copy source informationpublic boolean isMove()
true
if move operation should be done, otherwise false
public void setMove(boolean isMove)
isMove
- true
if move operation should be done, otherwise false
public boolean isMakeParents()
true
if non-existent parent directories should be created, otherwise false
public void setMakeParents(boolean isMakeParents)
isMakeParents
- true
if non-existent parent directories should be created, otherwise false
public boolean isFailWhenDstExists()
target
already exists.
true
if fail when target
already exists, otherwise false
SvnRemoteCopy
public void setFailWhenDstExists(boolean isFailWhenDstExist)
target
already exists.
isFailWhenDstExist
- true
if fail when target
already exists, otherwise false
SvnRemoteCopy
public boolean isIgnoreExternals()
true
if externals definitions should be ignored, otherwise false
public void setIgnoreExternals(boolean ignoreExternals)
ignoreExternals
- true
if externals definitions should be ignored, otherwise false
public boolean isVirtual()
true
if it is virtual copy, otherwise false
public void setVirtual(boolean virtual)
virtual
- true
if it is virtual copy, otherwise false
public boolean isDisjoint()
true
if it is disjoint working copy, otherwise false
public void setDisjoint(boolean disjoint)
disjoint
- true
if it is disjoint working copy, otherwise false
public boolean isChangesWorkingCopy()
isChangesWorkingCopy
in class SvnOperation<java.lang.Void>
true
if the operation changes the working copy, otherwise false
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |