Interface ISVNEditor
- All Known Implementing Classes:
CommitEditor
public interface ISVNEditor
This interface is EXPERIMENTAL. It may change or be removed in a future version of JavaHL
- Since:
- 1.9
- See Also:
- svn_editor.h for all restrictions on driving an editor.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ISVNEditor.GetNodeKindCallback
Callback interface for providing the kind of the node that was the source of a copy.static interface
ISVNEditor.ProvideBaseCallback
Callback interface for providing the base contents of a file that is being modified.static interface
ISVNEditor.ProvidePropsCallback
Callback interface for providing the base properties of a file or directory that is being modified. -
Method Summary
Modifier and Type Method Description void
abort()
Signal that the edit transmission was not successful.void
addAbsent(String relativePath, NodeKind kind, long replacesRevision)
Create an "absent" node of kindkind
atrelativePath
.void
addDirectory(String relativePath, Iterable<String> children, Map<String,byte[]> properties, long replacesRevision)
Create a new directory atrelativePath
.void
addFile(String relativePath, Checksum checksum, InputStream contents, Map<String,byte[]> properties, long replacesRevision)
Create a new file atrelativePath
.void
addSymlink(String relativePath, String target, Map<String,byte[]> properties, long replacesRevision)
Create a new symbolic link atrelativePath
, with a link target oftarget
.void
alterDirectory(String relativePath, long revision, Iterable<String> children, Map<String,byte[]> properties)
Alter the properties of the directory atrelativePath
.void
alterFile(String relativePath, long revision, Checksum checksum, InputStream contents, Map<String,byte[]> properties)
Alter the contents and/or the properties of the file atrelativePath
withrevision
as its expected revision.void
alterSymlink(String relativePath, long revision, String target, Map<String,byte[]> properties)
Alter the target and/or the properties of the symlink atrelativePath
withrevision
as its expected revision.void
complete()
Signal that the edit has been completed successfully.void
copy(String sourceRelativePath, long sourceRevision, String destinationRelativePath, long replacesRevision)
Move the node atsourceRelativePath
todestinationRelativePath
.void
delete(String relativePath, long revision)
Delete the existing node atrelativePath
, expected to be identical to revisionrevision
of that path.void
dispose()
Release the native peer (should not depend on finalize), and abort the edit if it has not been completed yet.void
move(String sourceRelativePath, long sourceRevision, String destinationRelativePath, long replacesRevision)
Move the node atsourceRelativePath
todestinationRelativePath
.
-
Method Details
-
dispose
void dispose()Release the native peer (should not depend on finalize), and abort the edit if it has not been completed yet. -
addDirectory
void addDirectory(String relativePath, Iterable<String> children, Map<String,byte[]> properties, long replacesRevision) throws ClientExceptionCreate a new directory atrelativePath
. The immediate parent ofrelativePath
is expected to exist.For descriptions of
properties
andreplacesRevision
, see #addFile().A complete listing of the immediate children of
relativePath
that will be added subsequently is given inchildren
.children
is a collection of const strings, each giving the basename of an immediate child. It is an error to passnull
forchildren
; use an empty collection to indicate that the new directory will have no children.- Throws:
ClientException
-
addFile
void addFile(String relativePath, Checksum checksum, InputStream contents, Map<String,byte[]> properties, long replacesRevision) throws ClientExceptionCreate a new file atrelativePath
. The immediate parent ofrelativePath
is expected to exist.The file's contents are specified in
contents
which has a checksum matchingchecksum
. Both values must be non-null
.Set the properties of the new file to
properties
. If no properties are being set on the new file,properties
must be empty. It is an error to passnull
forproperties
.If this add is expected to replace a previously existing file, symlink or directory at
relativePath
, the revision number of the node to be replaced must be given inreplacesRevision
. Otherwise,replacesRevision
must be Revision.SVN_INVALID_REVNUM.Note: It is not allowed to call a "delete" followed by an "add" on the same path. Instead, an "add" with
replacesRevision
set accordingly must be used.Note: The
contents
stream's lifetime must not extend beyond the scope of this function. An implementation must close the stream after consuming its contents.- Throws:
ClientException
-
addSymlink
void addSymlink(String relativePath, String target, Map<String,byte[]> properties, long replacesRevision) throws ClientExceptionCreate a new symbolic link atrelativePath
, with a link target oftarget
. The immediate parent ofrelativePath
is expected to exist. For descriptions ofproperties
andreplacesRevision
, see #addFile().- Throws:
ClientException
-
addAbsent
Create an "absent" node of kindkind
atrelativePath
. The immediate parent ofrelativePath
is expected to exist. For a description ofreplacesRevision
, see #addFile().- Throws:
ClientException
-
alterDirectory
void alterDirectory(String relativePath, long revision, Iterable<String> children, Map<String,byte[]> properties) throws ClientExceptionAlter the properties of the directory atrelativePath
.revision
specifies the revision at which the receiver should expect to find this node. That is,relativePath
at the start of the whole edit andrelativePath
atrevision
must lie within the same node-rev (aka location history segment). This information may be used to catch an attempt to alter and out-of-date directory. If the directory does not have a corresponding revision in the repository (e.g. it has not yet been committed), thenrevision
should be Revision.SVN_INVALID_REVNUM.If any changes to the set of children will be made in the future of the edit drive, then
children
must specify the resulting set of children. See #addDirectory() for the format ofchildren
. If not changes will be made, then NULL may be specified.For a description of
properties
, see #addFile(). If no changes to the properties will be made (ie. only future changes to the set of children), thenproperties
may benull
.- Throws:
ClientException
-
alterFile
void alterFile(String relativePath, long revision, Checksum checksum, InputStream contents, Map<String,byte[]> properties) throws ClientExceptionAlter the contents and/or the properties of the file atrelativePath
withrevision
as its expected revision. See #alterDirectory() for more information aboutrevision
.If
contents
is non-null
, then the stream will be copied to the file, and its checksum must matchchecksum
(which must also be non-null
). Ifcontents
isnull
, thenchecksum
must also benull
, and no change will be applied to the file's contents.If
properties
is non-null
, then the properties will be applied.For a description of
checksum
andcontents
, see #addFile().This function allows
properties
to benull
, but the parameter is otherwise described by #addFile().Note: The
contents
stream's lifetime must not extend beyond the scope of this function. An implementation must close the stream after consuming its contents.- Throws:
ClientException
-
alterSymlink
void alterSymlink(String relativePath, long revision, String target, Map<String,byte[]> properties) throws ClientExceptionAlter the target and/or the properties of the symlink atrelativePath
withrevision
as its expected revision. See #alterDirectory() for more information aboutrevision
.If
target
is non-null
, then the symlink's target will be updated.If
properties
is non-null
, then the properties will be applied.The target and/or the properties must be changed. It is an error to pass
null
for bothtarget
andproperties
.This function allows
properties
to benull
, but the parameter is otherwise described by #addFile().- Throws:
ClientException
-
delete
Delete the existing node atrelativePath
, expected to be identical to revisionrevision
of that path.- Throws:
ClientException
-
copy
void copy(String sourceRelativePath, long sourceRevision, String destinationRelativePath, long replacesRevision) throws ClientExceptionMove the node atsourceRelativePath
todestinationRelativePath
.For a description of
replacesRevision
, see #addFile().Note: See the general instructions on paths for this API. Sice the
sourceRelativePath
argument must generally be able to reference any node in the repository, the implication is that the editor's root must be the repository root.- Throws:
ClientException
-
move
void move(String sourceRelativePath, long sourceRevision, String destinationRelativePath, long replacesRevision) throws ClientExceptionMove the node atsourceRelativePath
todestinationRelativePath
.sourceRevision
specifies the revision at which the receiver should expect to find this node. That is,sourceRelativePath
at the start of the whole edit andsourceRelativePath
atsourceRevision
must lie within the same node-rev (aka history-segment). This is just like the #delete().For a description of
replacesRevision
, see #addFile().- Throws:
ClientException
-
complete
Signal that the edit has been completed successfully. After this method is called, the editor is considered closed.- Throws:
ClientException
-
abort
Signal that the edit transmission was not successful. After this method is called, the editor is considered closed.- Throws:
ClientException
-