3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
24
package org.apache.subversion.javahl.remote;
26
import org.apache.subversion.javahl.types.*;
27
import org.apache.subversion.javahl.callback.*;
29
import org.apache.subversion.javahl.ISVNEditor;
30
import org.apache.subversion.javahl.JNIObject;
31
import org.apache.subversion.javahl.ClientException;
32
import org.apache.subversion.javahl.NativeResources;
34
import java.io.InputStream;
39
* Implementation of ISVNEditor that drives commits.
42
public class CommitEditor extends JNIObject implements ISVNEditor
45
* Load the required native library.
49
NativeResources.loadNativeLibrary();
54
session.disposeEditor(this);
58
public native void addDirectory(String relativePath,
59
Iterable<String> children,
60
Map<String, byte[]> properties,
61
long replacesRevision)
62
throws ClientException;
64
public native void addFile(String relativePath,
67
Map<String, byte[]> properties,
68
long replacesRevision)
69
throws ClientException;
72
* <b>Note:</b> Not implemented.
74
public native void addSymlink(String relativePath,
76
Map<String, byte[]> properties,
77
long replacesRevision)
78
throws ClientException;
80
public native void addAbsent(String relativePath,
82
long replacesRevision)
83
throws ClientException;
85
public native void alterDirectory(String relativePath,
87
Iterable<String> children,
88
Map<String, byte[]> properties)
89
throws ClientException;
91
public native void alterFile(String relativePath,
95
Map<String, byte[]> properties)
96
throws ClientException;
99
* <b>Note:</b> Not implemented.
101
public native void alterSymlink(String relativePath,
104
Map<String, byte[]> properties)
105
throws ClientException;
107
public native void delete(String relativePath,
109
throws ClientException;
111
public native void copy(String sourceRelativePath,
113
String destinationRelativePath,
114
long replacesRevision)
115
throws ClientException;
117
public native void move(String sourceRelativePath,
119
String destinationRelativePath,
120
long replacesRevision)
121
throws ClientException;
123
public native void complete() throws ClientException;
125
public native void abort() throws ClientException;
128
* This factory method called from RemoteSession.getCommitEditor.
131
CommitEditor createInstance(RemoteSession session,
132
Map<String, byte[]> revisionProperties,
133
CommitCallback commitCallback,
134
Set<Lock> lockTokens, boolean keepLocks,
135
ISVNEditor.ProvideBaseCallback baseCB,
136
ISVNEditor.ProvidePropsCallback propsCB,
137
ISVNEditor.GetNodeKindCallback kindCB)
138
throws ClientException
140
long cppAddr = nativeCreateInstance(
141
session, revisionProperties, commitCallback,
142
lockTokens, keepLocks, baseCB, propsCB, kindCB);
143
return new CommitEditor(cppAddr, session);
147
* This constructor is called from the factory to get an instance.
149
protected CommitEditor(long cppAddr, RemoteSession session)
152
this.session = session;
155
/** Stores a reference to the session that created this editor. */
156
protected RemoteSession session;
159
public native void finalize() throws Throwable;
162
* Wrapped private native implementation declarations.
164
private native void nativeDispose();
165
private static final native
166
long nativeCreateInstance(RemoteSession session,
167
Map<String, byte[]> revisionProperties,
168
CommitCallback commitCallback,
169
Set<Lock> lockTokens, boolean keepLocks,
170
ISVNEditor.ProvideBaseCallback baseCB,
171
ISVNEditor.ProvidePropsCallback propsCB,
172
ISVNEditor.GetNodeKindCallback kindCB)
173
throws ClientException;