private static boolean arePropsEqual(SVNPropertyValue propertyValue1, SVNPropertyValue propertyValue2) { byte[] baseBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue1); byte[] incomingOldBytes = SVNPropertyValue.getPropertyAsBytes(propertyValue2); return Arrays.equals(baseBytes, incomingOldBytes); }
public static boolean areEqual(SVNPropertyValue propertyValue1, SVNPropertyValue propertyValue2) { if (propertyValue1 == null) { return propertyValue2 == null; } if (propertyValue2 == null) { return false; } byte[] propertyValueBytes1 = SVNPropertyValue.getPropertyAsBytes(propertyValue1); byte[] propertyValueBytes2 = SVNPropertyValue.getPropertyAsBytes(propertyValue2); return Arrays.equals(propertyValueBytes1, propertyValueBytes2); }
public void setPropertyValue(String name, SVNPropertyValue value) throws SVNException { byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); int length = bytes != null && bytes.length >= 0 ? bytes.length : -1; setPropertyValue(name, bytes != null ? new ByteArrayInputStream(bytes) : null, length); }
public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException { String fileToken = (String) myFilesToTokens.get(path); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-file-prop", fileToken, name, bytes}); }
public void setPropertyValue(String name, SVNPropertyValue value) throws SVNException { byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); int length = bytes != null && bytes.length >= 0 ? bytes.length : -1; setPropertyValue(name, bytes != null ? new ByteArrayInputStream(bytes) : null, length); }
public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException { String fileToken = (String) myFilesToTokens.get(path); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-file-prop", fileToken, name, bytes}); }
public void setPropertyValue(String name, SVNPropertyValue value) throws SVNException { byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); int length = bytes != null && bytes.length >= 0 ? bytes.length : -1; setPropertyValue(name, bytes != null ? new ByteArrayInputStream(bytes) : null, length); }
public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException { String fileToken = (String) myFilesToTokens.get(path); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-file-prop", fileToken, name, bytes}); }
protected static Map<String, byte[]> getProperties(SVNProperties svnProperties) { if (svnProperties == null) { return new HashMap<String, byte[]>(); } HashMap<String, byte[]> properties = new HashMap<String, byte[]>(); Set<String> svnPropertiesNames = svnProperties.nameSet(); for (String svnPropertyName : svnPropertiesNames) { SVNPropertyValue svnPropertyValue = svnProperties.getSVNPropertyValue(svnPropertyName); properties.put(svnPropertyName, SVNPropertyValue.getPropertyAsBytes(svnPropertyValue)); } return properties; }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-dir-prop", dirBaton.getToken(), name, bytes}); }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-dir-prop", dirBaton.getToken(), name, bytes}); }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirBaton dirBaton = (DirBaton) myDirsStack.peek(); byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); myConnection.write("(w(ss(b)))", new Object[]{"change-dir-prop", dirBaton.getToken(), name, bytes}); }
public byte[] getRevisionProperty(long revision, String propertyName) throws ClientException { try { final SVNPropertyValue propertyValue = svnRepository.getRevisionPropertyValue(revision, propertyName); return SVNPropertyValue.getPropertyAsBytes(propertyValue); } catch (SVNException e) { throw ClientException.fromException(e); } }
public static void appendProperty(String name, SVNPropertyValue value, OutputStream target) throws SVNException { if (name == null || value == null){ return; } byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); try { writeProperty(target, 'K', name.getBytes("UTF-8")); writeProperty(target, 'V', bytes); }catch(IOException ioe){ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.WC); } }
public static void appendProperty(String name, SVNPropertyValue value, OutputStream target) throws SVNException { if (name == null || value == null){ return; } byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); try { writeProperty(target, 'K', name.getBytes("UTF-8")); writeProperty(target, 'V', bytes); }catch(IOException ioe){ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.WC); } }
public static void appendProperty(String name, SVNPropertyValue value, OutputStream target) throws SVNException { if (name == null || value == null){ return; } byte[] bytes = SVNPropertyValue.getPropertyAsBytes(value); try { writeProperty(target, 'K', name.getBytes("UTF-8")); writeProperty(target, 'V', bytes); }catch(IOException ioe){ SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage()); SVNErrorManager.error(err, ioe, SVNLogType.WC); } }
public static PropertyData createPropertyData(Object client, String path, String name, SVNPropertyValue value) { if (client instanceof SVNClientImpl){ if (value.isString()) { return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); } if (value.isString()) { return new PropertyData((SVNClient) client, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new PropertyData((SVNClient) client, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); }
public static PropertyData createPropertyData(Object client, String path, String name, SVNPropertyValue value) { if (client instanceof SVNClientImpl){ if (value.isString()) { return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); } if (value.isString()) { return new PropertyData((SVNClient) client, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new PropertyData((SVNClient) client, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); }
public static PropertyData createPropertyData(Object client, String path, String name, SVNPropertyValue value) { if (client instanceof SVNClientImpl){ if (value.isString()) { return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); } if (value.isString()) { return new PropertyData((SVNClient) client, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new PropertyData((SVNClient) client, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); }
public static PropertyData createPropertyData(Object client, String path, String name, SVNPropertyValue value) { if (client instanceof SVNClientImpl){ if (value.isString()) { return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new JavaHLPropertyData((SVNClientImpl) client, null, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); } if (value.isString()) { return new PropertyData((SVNClient) client, path, name, value.getString(), SVNPropertyValue.getPropertyAsBytes(value)); } return new PropertyData((SVNClient) client, path, name, SVNPropertyValue.getPropertyAsString(value), value.getBytes()); }