public Map compareTo(SVNProperties properties) throws SVNException { final Map locallyChangedProperties = new HashMap(); compareTo(properties, new ISVNPropertyComparator() { public void propertyAdded(String name, InputStream value, int length) { propertyChanged(name, value, length);
public boolean compareTo(SVNProperties properties, ISVNPropertyComparator comparator) throws SVNException { boolean equals = true; Collection props1 = properties(null); Collection props2 = properties.properties(null);   Collection tmp = new TreeSet(props1); tmp.removeAll(props2); for (Iterator props = tmp.iterator(); props.hasNext();) { String missing = (String) props.next(); comparator.propertyDeleted(missing); equals = false; }   tmp = new TreeSet(props2); tmp.removeAll(props1);  File tmpFile = null; File tmpFile1 = null; File tmpFile2 = null; OutputStream os = null; InputStream is = null; InputStream is1 = null; InputStream is2 = null;  for (Iterator props = tmp.iterator(); props.hasNext();) { String added = (String) props.next(); try { tmpFile = SVNFileUtil.createUniqueFile(myFile.getParentFile(), myFile.getName(), ".tmp");  os = new FileOutputStream(tmpFile); properties.getPropertyValue(added, os); os.close();  is = new FileInputStream(tmpFile); comparator.propertyAdded(added, is, (int) tmpFile.length()); equals = false; is.close(); } catch (IOException e) { SVNErrorManager.error(0, e); } finally { if (tmpFile != null) { tmpFile.delete(); } if (os != null) { try { os.close(); } catch (IOException e) {} } if (is != null) { try { is.close(); } catch (IOException e) {} } tmpFile = null; is = null; os = null;
    public Map compareTo(SVNProperties properties) throws SVNException {        final Map locallyChangedProperties = new HashMap();        compareTo(properties, new ISVNPropertyComparator() {            public void propertyAdded(String name, InputStream value, int length) {                propertyChanged(name, value, length);            }            public void propertyChanged(String name, InputStream newValue, int length) {                ByteArrayOutputStream os = new ByteArrayOutputStream(length);                for(int i = 0; i < length; i++) {                    try {                        os.write(newValue.read());                    } catch (IOException e) {                    }                }                byte[] bytes = os.toByteArray();                try {                    locallyChangedProperties.put(name, new String(bytes, "UTF-8"));                } catch (UnsupportedEncodingException e) {                    locallyChangedProperties.put(name, new String(bytes));                }            }            public void propertyDeleted(String name) {                locallyChangedProperties.put(name, null);            }        });        return locallyChangedProperties;            }