diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableAdapter.java
new file mode 100644
index 0000000..98f8a8a
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableAdapter.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt;
+
+/**
+ *
+ * Attention! It accepts null
and may return null
+ */
+public interface SvnNullableAdapter extends SvnTypeAdapter {
+
+ /**
+ * Attention! It may return null
+ */
+ @Override
+ T adapt();
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableConstructor.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableConstructor.java
new file mode 100644
index 0000000..9980e0e
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnNullableConstructor.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt;
+
+import java.util.Optional;
+
+/**
+ *
+ * They are not kidding, and really transfer null
> values here and there
+ */
+public abstract class SvnNullableConstructor implements SvnNullableAdapter {
+
+ private final Optional optional;
+
+ public SvnNullableConstructor(S source) {
+ optional = Optional.ofNullable(source);
+ }
+
+ @Override
+ public final T adapt() {
+ return optional.map(this::adapt).orElse(null);
+ }
+
+ protected abstract T adapt(S source);
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeAdapter.java
index a12f48c..e21cecc 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeAdapter.java
@@ -22,7 +22,7 @@
package ru.arsysop.svn.connector.internal.adapt;
-interface SvnTypeAdapter {
+public interface SvnTypeAdapter {
T adapt();
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeConstructor.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeConstructor.java
index a9dc8d3..99afe41 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeConstructor.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeConstructor.java
@@ -23,11 +23,11 @@
import java.util.Objects;
-abstract class SvnTypeConstructor implements SvnTypeAdapter {
+public abstract class SvnTypeConstructor implements SvnTypeAdapter {
protected final S source;
- SvnTypeConstructor(S source) {
+ public SvnTypeConstructor(S source) {
this.source = Objects.requireNonNull(source);
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeMap.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeMap.java
index 04d60c8..3e45c0b 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeMap.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/SvnTypeMap.java
@@ -25,7 +25,7 @@
import java.util.Objects;
import java.util.Optional;
-abstract class SvnTypeMap implements SvnTypeAdapter {
+public abstract class SvnTypeMap implements SvnTypeAdapter {
private final S source;
private final Map map;
@@ -42,6 +42,6 @@ public final T adapt() {
return Optional.ofNullable(map.get(source)).orElseGet(this::defaults);
}
- abstract T defaults();
+ protected abstract T defaults();
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ChecksumNullableAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ChecksumNullableAdapter.java
new file mode 100644
index 0000000..bf166ea
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ChecksumNullableAdapter.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import org.apache.subversion.javahl.types.Checksum;
+import org.eclipse.team.svn.core.connector.SVNChecksum;
+import org.eclipse.team.svn.core.connector.SVNChecksum.Kind;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class ChecksumNullableAdapter extends SvnNullableConstructor {
+
+ public ChecksumNullableAdapter(Checksum source) {
+ super(source);
+ }
+
+ @Override
+ protected SVNChecksum adapt(Checksum checksum) {
+ return new SVNChecksum(
+ kind(checksum), //
+ checksum.getDigest());
+ }
+
+ private Kind kind(Checksum checksum) {
+ return checksum.getKind() == org.apache.subversion.javahl.types.Checksum.Kind.MD5
+ ? SVNChecksum.Kind.MD5
+ : SVNChecksum.Kind.SHA1;
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationActionAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationActionAdapter.java
similarity index 97%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationActionAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationActionAdapter.java
index 486ab7f..fb49bb5 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationActionAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationActionAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -28,6 +28,8 @@
import org.eclipse.team.svn.core.connector.SVNNotification;
import org.eclipse.team.svn.core.connector.SVNNotification.PerformedAction;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap;
+
final class ClientNotifyInformationActionAdapter extends SvnTypeMap {
ClientNotifyInformationActionAdapter(Action source) {
@@ -117,7 +119,7 @@ protected Map fill() {
}
@Override
- SVNNotification.PerformedAction defaults() {
+ protected SVNNotification.PerformedAction defaults() {
return SVNNotification.PerformedAction._UNKNOWN_ACTION;
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationAdapter.java
similarity index 78%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationAdapter.java
index 0b079f0..d6ab97c 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationAdapter.java
@@ -19,14 +19,16 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import org.apache.subversion.javahl.ClientNotifyInformation;
import org.eclipse.team.svn.core.connector.SVNNotification;
-final class ClientNotifyInformationAdapter extends SvnTypeConstructor {
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeConstructor;
- ClientNotifyInformationAdapter(ClientNotifyInformation source) {
+public final class ClientNotifyInformationAdapter extends SvnTypeConstructor {
+
+ public ClientNotifyInformationAdapter(ClientNotifyInformation source) {
super(source);
}
@@ -37,7 +39,7 @@ public SVNNotification adapt() {
new ClientNotifyInformationActionAdapter(source.getAction()).adapt(), //
new NodeKindAdapter(source.getKind()).adapt(), //
source.getMimeType(), //
- new LockAdapter(source.getLock()).adapt(), //
+ new LockNullableAdapter(source.getLock()).adapt(), //
source.getErrMsg(), //
new ClientNotifyInformationStatusAdapter(source.getContentState()).adapt(), //
new ClientNotifyInformationStatusAdapter(source.getPropState()).adapt(), //
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationStatusAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationStatusAdapter.java
similarity index 93%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationStatusAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationStatusAdapter.java
index 0cbecb3..f43a901 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyInformationStatusAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ClientNotifyInformationStatusAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -29,6 +29,8 @@
import org.eclipse.team.svn.core.connector.SVNNotification;
import org.eclipse.team.svn.core.connector.SVNNotification.NodeStatus;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap;
+
final class ClientNotifyInformationStatusAdapter
extends SvnTypeMap {
@@ -51,7 +53,7 @@ protected Map fill() {
}
@Override
- NodeStatus defaults() {
+ protected NodeStatus defaults() {
return NodeStatus.UNKNOWN;
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictDescriptorNullableAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictDescriptorNullableAdapter.java
new file mode 100644
index 0000000..2e13a4d
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictDescriptorNullableAdapter.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.subversion.javahl.ConflictDescriptor;
+import org.apache.subversion.javahl.ConflictDescriptor.Operation;
+import org.apache.subversion.javahl.ConflictDescriptor.Reason;
+import org.eclipse.team.svn.core.connector.SVNConflictDescriptor;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class ConflictDescriptorNullableAdapter
+extends SvnNullableConstructor {
+
+ private Map reasons;
+
+ public ConflictDescriptorNullableAdapter(ConflictDescriptor source) {
+ super(source);
+ reasons = new HashMap<>();
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.edited,
+ SVNConflictDescriptor.Reason.MODIFIED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.obstructed,
+ SVNConflictDescriptor.Reason.OBSTRUCTED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.deleted,
+ SVNConflictDescriptor.Reason.DELETED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.missing,
+ SVNConflictDescriptor.Reason.MISSING);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.unversioned,
+ SVNConflictDescriptor.Reason.UNVERSIONED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.added, SVNConflictDescriptor.Reason.ADDED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.replaced,
+ SVNConflictDescriptor.Reason.REPLACED);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.moved_away,
+ SVNConflictDescriptor.Reason.MOVED_AWAY);
+ reasons.put(org.apache.subversion.javahl.ConflictDescriptor.Reason.moved_here,
+ SVNConflictDescriptor.Reason.MOVED_HERE);
+
+ }
+
+ @Override
+ protected SVNConflictDescriptor adapt(ConflictDescriptor descr) {
+ return new SVNConflictDescriptor(
+ descr.getPath(), //
+ kind(descr.getKind()), //
+ new NodeKindAdapter(descr.getNodeKind()).adapt(), //
+ descr.getPropertyName(), //
+ descr.isBinary(), //
+ descr.getMIMEType(), //
+ action(descr.getAction()), //
+ reason(descr.getReason()), //
+ operation(descr.getOperation()), //
+ descr.getBasePath(), //
+ descr.getTheirPath(), //
+ descr.getMyPath(), //
+ descr.getMergedPath(), //
+ new ConflictVersionNullableAdapter(descr.getSrcLeftVersion()).adapt(),
+ new ConflictVersionNullableAdapter(descr.getSrcRightVersion()).adapt());
+ }
+
+ private SVNConflictDescriptor.Kind kind(org.apache.subversion.javahl.ConflictDescriptor.Kind kind) {
+ if (kind == org.apache.subversion.javahl.ConflictDescriptor.Kind.property) {
+ return SVNConflictDescriptor.Kind.PROPERTIES;
+ } else if (kind == org.apache.subversion.javahl.ConflictDescriptor.Kind.tree) {
+ return SVNConflictDescriptor.Kind.TREE;
+ }
+ return SVNConflictDescriptor.Kind.CONTENT;
+ }
+
+ private SVNConflictDescriptor.Action action(org.apache.subversion.javahl.ConflictDescriptor.Action tAction) {
+ SVNConflictDescriptor.Action action = SVNConflictDescriptor.Action.ADD;
+ if (tAction == org.apache.subversion.javahl.ConflictDescriptor.Action.edit) {
+ action = SVNConflictDescriptor.Action.MODIFY;
+ } else if (tAction == org.apache.subversion.javahl.ConflictDescriptor.Action.delete) {
+ action = SVNConflictDescriptor.Action.DELETE;
+ } else if (tAction == org.apache.subversion.javahl.ConflictDescriptor.Action.replace) {
+ action = SVNConflictDescriptor.Action.REPLACE;
+ }
+ return action;
+ }
+
+ private SVNConflictDescriptor.Reason reason(Reason reason) {
+ return Optional.ofNullable(reasons.get(reason)).orElse(SVNConflictDescriptor.Reason.MODIFIED);
+ }
+
+ private SVNConflictDescriptor.Operation operation(Operation operation) {
+ if (operation == Operation.merge) {
+ return SVNConflictDescriptor.Operation.MERGE;
+ } else if (operation == Operation.switched) {
+ return SVNConflictDescriptor.Operation.SWITCHED;
+ } else if (operation == Operation.update) {
+ return SVNConflictDescriptor.Operation.UPDATE;
+ }
+ return SVNConflictDescriptor.Operation.NONE;
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictVersionNullableAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictVersionNullableAdapter.java
new file mode 100644
index 0000000..f715fad
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/ConflictVersionNullableAdapter.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import org.apache.subversion.javahl.types.ConflictVersion;
+import org.eclipse.team.svn.core.connector.SVNConflictVersion;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class ConflictVersionNullableAdapter extends SvnNullableConstructor {
+
+ public ConflictVersionNullableAdapter(ConflictVersion source) {
+ super(source);
+ }
+
+ @Override
+ protected SVNConflictVersion adapt(ConflictVersion source) {
+ return new SVNConflictVersion(//
+ source.getReposURL(), //
+ source.getPegRevision(), //
+ source.getPathInRepos(), //
+ new NodeKindAdapter(source.getNodeKind()).adapt());
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/DepthAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/DepthAdapter.java
new file mode 100644
index 0000000..bd29a7b
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/DepthAdapter.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import org.apache.subversion.javahl.types.Depth;
+import org.eclipse.team.svn.core.connector.SVNDepth;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class DepthAdapter extends SvnNullableConstructor {
+
+ public DepthAdapter(Depth depth) {
+ super(depth);
+ }
+
+ @Override
+ protected SVNDepth adapt(Depth source) {
+ if (source == org.apache.subversion.javahl.types.Depth.exclude) {
+ return SVNDepth.EXCLUDE;
+ }
+ if (source == org.apache.subversion.javahl.types.Depth.empty) {
+ return SVNDepth.EMPTY;
+ }
+ if (source == org.apache.subversion.javahl.types.Depth.files) {
+ return SVNDepth.FILES;
+ }
+ if (source == org.apache.subversion.javahl.types.Depth.immediates) {
+ return SVNDepth.IMMEDIATES;
+ }
+ if (source == org.apache.subversion.javahl.types.Depth.infinity) {
+ return SVNDepth.INFINITY;
+ }
+ return SVNDepth.UNKNOWN;
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/InfoNullableAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/InfoNullableAdapter.java
new file mode 100644
index 0000000..3abcbcd
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/InfoNullableAdapter.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.apache.subversion.javahl.types.Info;
+import org.eclipse.team.svn.core.connector.SVNConflictDescriptor;
+import org.eclipse.team.svn.core.connector.SVNEntryInfo;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class InfoNullableAdapter extends SvnNullableConstructor {
+
+ public InfoNullableAdapter(Info source) {
+ super(source);
+ }
+
+ @Override
+ protected SVNEntryInfo adapt(Info info) {
+ org.apache.subversion.javahl.types.Info.ScheduleKind tScheduleKind = info.getSchedule();
+ SVNEntryInfo.ScheduledOperation scheduleKind = SVNEntryInfo.ScheduledOperation.NORMAL;
+ if (tScheduleKind == org.apache.subversion.javahl.types.Info.ScheduleKind.add) {
+ scheduleKind = SVNEntryInfo.ScheduledOperation.ADD;
+ } else if (tScheduleKind == org.apache.subversion.javahl.types.Info.ScheduleKind.delete) {
+ scheduleKind = SVNEntryInfo.ScheduledOperation.DELETE;
+ } else if (tScheduleKind == org.apache.subversion.javahl.types.Info.ScheduleKind.replace) {
+ scheduleKind = SVNEntryInfo.ScheduledOperation.REPLACE;
+ }
+ long changeTime = info.getTextTime() == null ? 0 : info.getTextTime().getTime();
+ return new SVNEntryInfo(//
+ info.getPath(), //
+ info.getWcroot(), //
+ info.getUrl(), //
+ info.getRev(), //
+ new NodeKindAdapter(info.getKind()).adapt(), //
+ info.getReposRootUrl(), //
+ info.getReposUUID(), //
+ info.getLastChangedRev(), //
+ Optional.ofNullable(info.getLastChangedDate()).map(Date::getTime).orElse(0L),
+ info.getLastChangedAuthor(), //
+ new LockNullableAdapter(info.getLock()).adapt(), //
+ info.isHasWcInfo(), //
+ scheduleKind, //
+ info.getCopyFromUrl(), //
+ info.getCopyFromRev(), //
+ changeTime, //
+ changeTime, //
+ new ChecksumNullableAdapter(info.getChecksum()).adapt(), //
+ info.getChangelistName(), //
+ info.getWorkingSize(), //
+ info.getReposSize(), //
+ new DepthAdapter(info.getDepth()).adapt(), conflictDescriptors(info)//
+ );
+ }
+
+ private SVNConflictDescriptor[] conflictDescriptors(Info info) {
+ return Optional.ofNullable(info.getConflicts())
+ .orElseGet(Collections::emptySet)
+ .stream()
+ .map(ConflictDescriptorNullableAdapter::new)
+ .collect(Collectors.toList())
+ .toArray(new SVNConflictDescriptor[0]);
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockNullableAdapter.java
similarity index 65%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockNullableAdapter.java
index 0996e45..c7a45e7 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockNullableAdapter.java
@@ -19,26 +19,31 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
+
+import java.util.Date;
+import java.util.Optional;
import org.apache.subversion.javahl.types.Lock;
import org.eclipse.team.svn.core.connector.SVNLock;
-public final class LockAdapter extends SvnTypeConstructor {
+import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor;
+
+public final class LockNullableAdapter extends SvnNullableConstructor {
- public LockAdapter(Lock source) {
+ public LockNullableAdapter(Lock source) {
super(source);
}
@Override
- public SVNLock adapt() {
+ protected SVNLock adapt(Lock source) {
return new SVNLock(
source.getOwner(), //
source.getPath(), //
source.getToken(), //
source.getComment(), //
- source.getCreationDate() == null ? 0 : source.getCreationDate().getTime(), //
- source.getExpirationDate() == null ? 0 : source.getExpirationDate().getTime()//
+ Optional.ofNullable(source.getCreationDate()).map(Date::getTime).orElse(0L), //
+ Optional.ofNullable(source.getExpirationDate()).map(Date::getTime).orElse(0L)//
);
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockStatusAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockStatusAdapter.java
similarity index 91%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockStatusAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockStatusAdapter.java
index 46bb2cd..deaa3e8 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/LockStatusAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/LockStatusAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -28,6 +28,8 @@
import org.eclipse.team.svn.core.connector.SVNNotification;
import org.eclipse.team.svn.core.connector.SVNNotification.NodeLock;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap;
+
final class LockStatusAdapter extends SvnTypeMap {
LockStatusAdapter(LockStatus source) {
@@ -46,7 +48,7 @@ protected Map fill() {
}
@Override
- NodeLock defaults() {
+ protected NodeLock defaults() {
return NodeLock.UNKNOWN;
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/NodeKindAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/NodeKindAdapter.java
similarity index 90%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/NodeKindAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/NodeKindAdapter.java
index ea6bddd..433a811 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/NodeKindAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/NodeKindAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.Map;
@@ -27,6 +27,8 @@
import org.eclipse.team.svn.core.connector.SVNEntry;
import org.eclipse.team.svn.core.connector.SVNEntry.Kind;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap;
+
public final class NodeKindAdapter extends SvnTypeMap {
public NodeKindAdapter(NodeKind source) {
@@ -45,7 +47,7 @@ protected Map fill() {
}
@Override
- Kind defaults() {
+ protected Kind defaults() {
return Kind.UNKNOWN;
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/StatusKindAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/StatusKindAdapter.java
similarity index 93%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/StatusKindAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/StatusKindAdapter.java
index 72af51b..b753f00 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/StatusKindAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/StatusKindAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -28,6 +28,8 @@
import org.apache.subversion.javahl.types.Status.Kind;
import org.eclipse.team.svn.core.connector.SVNEntryStatus;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeMap;
+
final class StatusKindAdapter extends SvnTypeMap {
protected StatusKindAdapter(Kind source) {
@@ -55,7 +57,7 @@ protected Map fill() {
}
@Override
- SVNEntryStatus.Kind defaults() {
+ protected SVNEntryStatus.Kind defaults() {
return SVNEntryStatus.Kind.NONE;
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/TypeStatusAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/TypeStatusAdapter.java
similarity index 89%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/TypeStatusAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/TypeStatusAdapter.java
index 3cfb58a..02d8a76 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/TypeStatusAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/jhlsv/TypeStatusAdapter.java
@@ -19,7 +19,7 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.jhlsv;
import java.util.Date;
import java.util.Optional;
@@ -27,6 +27,8 @@
import org.apache.subversion.javahl.types.Status;
import org.eclipse.team.svn.core.connector.SVNChangeStatus;
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeConstructor;
+
public final class TypeStatusAdapter
extends SvnTypeConstructor {
@@ -51,8 +53,8 @@ public SVNChangeStatus adapt() {
source.isLocked(), //
source.isCopied(), //
source.isSwitched(), //
- new LockAdapter(source.getLocalLock()).adapt(), //
- new LockAdapter(source.getReposLock()).adapt(), //
+ new LockNullableAdapter(source.getLocalLock()).adapt(), //
+ new LockNullableAdapter(source.getReposLock()).adapt(), //
source.getReposLastCmtRevisionNumber(), //
Optional.ofNullable(source.getReposLastCmtDate()).map(Date::getTime).orElse(0L),
new NodeKindAdapter(source.getReposKind()).adapt(), //
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyCallbackAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/ClientNotifyCallbackAdapter.java
similarity index 89%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyCallbackAdapter.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/ClientNotifyCallbackAdapter.java
index 183f9f3..f893715 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/ClientNotifyCallbackAdapter.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/ClientNotifyCallbackAdapter.java
@@ -19,10 +19,12 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.adapt;
+package ru.arsysop.svn.connector.internal.adapt.svjhl;
import org.eclipse.team.svn.core.connector.ISVNNotificationCallback;
+import ru.arsysop.svn.connector.internal.adapt.jhlsv.ClientNotifyInformationAdapter;
+
public final class ClientNotifyCallbackAdapter implements org.apache.subversion.javahl.callback.ClientNotifyCallback {
private final ISVNNotificationCallback callback;
@@ -35,6 +37,7 @@ public ISVNNotificationCallback callback() {
return callback;
}
+ @Override
public void onNotify(org.apache.subversion.javahl.ClientNotifyInformation info) {
callback.notify(new ClientNotifyInformationAdapter(info).adapt());
}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/DepthJavahlSubversive.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/DepthAdapter.java
similarity index 75%
rename from bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/DepthJavahlSubversive.java
rename to bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/DepthAdapter.java
index 4da1bbb..c90504c 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/DepthJavahlSubversive.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/DepthAdapter.java
@@ -19,19 +19,25 @@
* ArSysOp - initial API and implementation
*/
-package ru.arsysop.svn.connector.internal.svnkit1_10;
+package ru.arsysop.svn.connector.internal.adapt.svjhl;
+import java.util.Objects;
+
+import org.apache.subversion.javahl.types.Depth;
import org.eclipse.team.svn.core.connector.SVNDepth;
-final class DepthJavahlSubversive {
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeAdapter;
+
+public final class DepthAdapter implements SvnTypeAdapter {
private final SVNDepth depth;
- DepthJavahlSubversive(SVNDepth depth) {
- this.depth = depth;
+ public DepthAdapter(SVNDepth depth) {
+ this.depth = Objects.requireNonNull(depth);
}
- org.apache.subversion.javahl.types.Depth adapt() {
+ @Override
+ public org.apache.subversion.javahl.types.Depth adapt() {
switch (depth) {
case EXCLUDE:
return org.apache.subversion.javahl.types.Depth.exclude;
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/InfoCallbackAdapter.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/InfoCallbackAdapter.java
new file mode 100644
index 0000000..1c51adb
--- /dev/null
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/InfoCallbackAdapter.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2023, 2024 ArSysOp
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Contributors:
+ * ArSysOp - initial API and implementation
+ */
+
+package ru.arsysop.svn.connector.internal.adapt.svjhl;
+
+import java.util.Objects;
+
+import org.apache.subversion.javahl.callback.InfoCallback;
+import org.eclipse.team.svn.core.connector.ISVNEntryInfoCallback;
+
+import ru.arsysop.svn.connector.internal.adapt.SvnTypeAdapter;
+import ru.arsysop.svn.connector.internal.adapt.jhlsv.InfoNullableAdapter;
+
+public final class InfoCallbackAdapter implements SvnTypeAdapter {
+
+ private final ISVNEntryInfoCallback source;
+
+ public InfoCallbackAdapter(ISVNEntryInfoCallback source) {
+ this.source = Objects.requireNonNull(source);
+ }
+
+ @Override
+ public InfoCallback adapt() {
+ return new org.apache.subversion.javahl.callback.InfoCallback() {
+
+ public void singleInfo(org.apache.subversion.javahl.types.Info info) {
+ //FIXME: AF: should we filter out null value?
+ source.next(new InfoNullableAdapter(info).adapt());
+ }
+
+ };
+ }
+
+}
diff --git a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/SvnKit1_10Connector.java b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/SvnKit1_10Connector.java
index c03eb26..8b8ca26 100644
--- a/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/SvnKit1_10Connector.java
+++ b/bundles/ru.arsysop.svn.connector.svnkit1_10/src/ru/arsysop/svn/connector/internal/svnkit1_10/SvnKit1_10Connector.java
@@ -23,6 +23,7 @@
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -63,9 +64,11 @@
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil;
import org.tmatesoft.svn.core.javahl17.SVNClientImpl;
-import ru.arsysop.svn.connector.internal.adapt.ClientNotifyCallbackAdapter;
-import ru.arsysop.svn.connector.internal.adapt.LockAdapter;
-import ru.arsysop.svn.connector.internal.adapt.NodeKindAdapter;
+import ru.arsysop.svn.connector.internal.adapt.jhlsv.LockNullableAdapter;
+import ru.arsysop.svn.connector.internal.adapt.jhlsv.NodeKindAdapter;
+import ru.arsysop.svn.connector.internal.adapt.svjhl.ClientNotifyCallbackAdapter;
+import ru.arsysop.svn.connector.internal.adapt.svjhl.DepthAdapter;
+import ru.arsysop.svn.connector.internal.adapt.svjhl.InfoCallbackAdapter;
//TODO
final class SvnKit1_10Connector implements ISVNConnector {
@@ -397,8 +400,21 @@ public void diffStatus(SVNEntryReference reference, SVNRevisionRange range, SVND
@Override
public void getInfo(SVNEntryRevisionReference reference, SVNDepth depth, long options, String[] changeLists,
ISVNEntryInfoCallback cb, ISVNProgressMonitor monitor) throws SVNConnectorException {
- System.out.println("SvnKit1_10Connector.getInfo()");
- //TODO
+ Map parameters = new HashMap<>();
+ parameters.put("reference", reference); //$NON-NLS-1$
+ parameters.put("depth", depth); //$NON-NLS-1$
+ parameters.put("options", Long.valueOf(options)); //$NON-NLS-1$
+ parameters.put("changeLists", changeLists); //$NON-NLS-1$
+ parameters.put("cb", cb); //$NON-NLS-1$
+ parameters.put("monitor", monitor); //$NON-NLS-1$
+ watch.operation(ISVNCallListener.GET_INFO, parameters, callback(monitor),
+ p -> client.info2(//
+ reference.path, //
+ new RevisionJavahlSubversive(reference.revision).adapt(), //
+ new RevisionJavahlSubversive(reference.pegRevision).adapt(), //
+ new DepthAdapter(depth).adapt(), //
+ Optional.ofNullable(changeLists).map(Arrays::asList).orElse(null), //FIXME: AF: investigate if we can provide empty list here
+ new InfoCallbackAdapter(cb).adapt()));
}
@Override
@@ -488,7 +504,7 @@ public void listEntries(SVNEntryRevisionReference reference, SVNDepth depth, int
parameters.put("options", Long.valueOf(options)); //$NON-NLS-1$
parameters.put("cb", cb); //$NON-NLS-1$
parameters.put("monitor", monitor); //$NON-NLS-1$
- watch.operation(ISVNCallListener.LIST, parameters, new ProgressCallback(monitor, client::cancelOperation),
+ watch.operation(ISVNCallListener.LIST, parameters, callback(monitor),
p -> listEntries(reference, depth, fields, options, cb));
}
@@ -498,7 +514,7 @@ private void listEntries(SVNEntryRevisionReference reference, SVNDepth depth, in
reference.path, //
new RevisionJavahlSubversive(reference.revision).adapt(), //
new RevisionJavahlSubversive(reference.pegRevision).adapt(), //
- new DepthJavahlSubversive(depth).adapt(), //
+ new DepthAdapter(depth).adapt(), //
fields, //
(options & Options.FETCH_LOCKS) != 0, //
new org.apache.subversion.javahl.callback.ListCallback() {
@@ -517,7 +533,7 @@ public void doEntry(org.apache.subversion.javahl.types.DirEntry entry,
entry.getHasProps(), //
new NodeKindAdapter(entry.getNodeKind()).adapt(), //
entry.getSize(), //
- new LockAdapter(lock).adapt()));
+ new LockNullableAdapter(lock).adapt()));
}
}
@@ -596,6 +612,10 @@ public void vacuum(String path, long options, ISVNProgressMonitor monitor) throw
//TODO
}
+ private ProgressCallback callback(ISVNProgressMonitor monitor) {
+ return new ProgressCallback(monitor, client::cancelOperation);
+ }
+
@Override
public void dispose() {
client.dispose();