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.util;
26
import org.apache.subversion.javahl.SVNUtil;
27
import org.apache.subversion.javahl.ClientException;
28
import org.apache.subversion.javahl.SubversionException;
29
import org.apache.subversion.javahl.NativeResources;
30
import org.apache.subversion.javahl.types.ExternalItem;
31
import org.apache.subversion.javahl.types.NodeKind;
32
import org.apache.subversion.javahl.types.Revision;
34
import java.util.List;
35
import java.io.InputStream;
38
* Encapsulates utility functions for properties provided by libsvn_wc.
44
* Load the required native library.
48
NativeResources.loadNativeLibrary();
51
/** @see SVNUtil#canonicalizeSvnProperty */
52
public byte[] canonicalizeNodeProperty(String name, byte[] value,
53
String path, NodeKind kind,
55
InputStream fileContents)
56
throws ClientException
58
if (!name.startsWith("svn:"))
59
throw new IllegalArgumentException("Property name: " + name);
60
return checkNodeProp(name, value, path, kind, mimeType, fileContents,
61
(kind != NodeKind.file || mimeType == null));
64
private native byte[] checkNodeProp(String name, byte[] value,
65
String path, NodeKind kind,
67
InputStream fileContents,
68
boolean skipSomeChecks)
69
throws ClientException;
72
/** @see SVNUtil.parseExternals */
73
public native List<ExternalItem> parseExternals(byte[] description,
74
String parentDirectory,
75
boolean canonicalizeUrl)
76
throws ClientException;
78
/** @see SVNUtil#unparseExternals */
79
public native byte[] unparseExternals(List<ExternalItem> items,
80
String parentDirectory,
82
throws SubversionException;
85
/** @see SVNUtil#resolveExternalsUrl */
86
public native String resolveExternalsUrl(ExternalItem external,
89
throws ClientException;