protected void categorizeProperties(Map original, Map regular, Map entry, Map wc) { if (original == null) { return; } for(Iterator propNames = original.keySet().iterator(); propNames.hasNext();) { String name = (String) propNames.next(); if (SVNProperty.isRegularProperty(name) && regular != null) { regular.put(name, original.get(name)); } else if (SVNProperty.isEntryProperty(name) && entry != null) { entry.put(name, original.get(name)); } else if (SVNProperty.isWorkingCopyProperty(name) && wc != null) { wc.put(name, original.get(name)); } } }
/** * Checks if a property is regular. * * <p/> * A property is considered to be regular if it is not <span class="javakeyword">null</span> and * does not start neither with {@link #SVN_WC_PREFIX} nor with {@link #SVN_ENTRY_PREFIX}. * * @param name a property name * @return <span class="javakeyword">true</span> if regular, otherwise * <span class="javakeyword">false</span> */ public static boolean isRegularProperty(String name) { if (name == null) { return false; } else if (isWorkingCopyProperty(name) || isEntryProperty(name)) { return false; } else { return true; } }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { if (dirBaton.skip) { return; } if (SVNProperty.isWorkingCopyProperty(name)) { return; } else if (SVNProperty.isRegularProperty(name)) { dirBaton.hasPropChange = true; } dirBaton.propChanges.put(name, value); }
public void changeFileProperty(String path, String propertyName, SVNPropertyValue propertyValue) throws SVNException { FileBaton fb = fileBaton; if (fb.skip) { return; } if (SVNProperty.isWorkingCopyProperty(propertyName)) { return; } else if (SVNProperty.isRegularProperty(propertyName)) { fb.hasPropChanges = true; } fb.propChanges.put(propertyName, propertyValue); }
public void changeFileProperty(String path, String propertyName, SVNPropertyValue propertyValue) throws SVNException { if (SVNProperty.isWorkingCopyProperty(propertyName)) { return; } else if (SVNProperty.isRegularProperty(propertyName)) { currentEntry.hasPropChange = true; if (currentEntry.propChanges == null) { currentEntry.propChanges = new SVNProperties(); } currentEntry.propChanges.put(propertyName, propertyValue); } }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { if (SVNProperty.isWorkingCopyProperty(name)) { return; } else if (SVNProperty.isRegularProperty(name)) { currentEntry.hasPropChange = true; if (currentEntry.propChanges == null) { currentEntry.propChanges = new SVNProperties(); } currentEntry.propChanges.put(name, value); } currentEntry.changePropertyCalled = true; }
public void changeFileProperty(String path, String propertyName, SVNPropertyValue propertyValue) throws SVNException { FileBaton fb = currentFile; if (fb.skip) { return; } if (SVNProperty.isWorkingCopyProperty(propertyName)) { return; } else if (SVNProperty.isRegularProperty(propertyName)) { fb.hasPropChange = true; } if (fb.propChanges == null) { fb.propChanges = new SVNProperties(); } fb.propChanges.put(propertyName, propertyValue); }
public void changeDirProperty(String name, SVNPropertyValue value) throws SVNException { DirectoryBaton db = currentDirectory; if (db.skip) { return; } if (SVNProperty.isWorkingCopyProperty(name)) { return; } else if (SVNProperty.isRegularProperty(name)) { db.hasPropChange = true; } if (db.propChanges == null) { db.propChanges = new SVNProperties(); } db.propChanges.put(name, value); }
protected void categorizeProperties(SVNProperties original, SVNProperties regular, SVNProperties entry, SVNProperties wc) { if (original == null) { return; } for(Iterator propNames = original.nameSet().iterator(); propNames.hasNext();) { String name = (String) propNames.next(); if (regular != null && SVNProperty.isRegularProperty(name)) { regular.put(name, original.getSVNPropertyValue(name)); } else if (entry != null && SVNProperty.isEntryProperty(name)) { entry.put(name, original.getSVNPropertyValue(name)); } else if (wc != null && SVNProperty.isWorkingCopyProperty(name)) { wc.put(name, original.getSVNPropertyValue(name)); } } }
protected void categorizeProperties(SVNProperties original, SVNProperties regular, SVNProperties entry, SVNProperties wc) { if (original == null) { return; } for(Iterator propNames = original.nameSet().iterator(); propNames.hasNext();) { String name = (String) propNames.next(); if (regular != null && SVNProperty.isRegularProperty(name)) { regular.put(name, original.getSVNPropertyValue(name)); } else if (entry != null && SVNProperty.isEntryProperty(name)) { entry.put(name, original.getSVNPropertyValue(name)); } else if (wc != null && SVNProperty.isWorkingCopyProperty(name)) { wc.put(name, original.getSVNPropertyValue(name)); } } }
protected void categorizeProperties(SVNProperties original, SVNProperties regular, SVNProperties entry, SVNProperties wc) { if (original == null) { return; } for(Iterator propNames = original.nameSet().iterator(); propNames.hasNext();) { String name = (String) propNames.next(); if (regular != null && SVNProperty.isRegularProperty(name)) { regular.put(name, original.getSVNPropertyValue(name)); } else if (entry != null && SVNProperty.isEntryProperty(name)) { entry.put(name, original.getSVNPropertyValue(name)); } else if (wc != null && SVNProperty.isWorkingCopyProperty(name)) { wc.put(name, original.getSVNPropertyValue(name)); } } }
public static void categorizeProperties(SVNProperties props, SVNProperties regular, SVNProperties entry, SVNProperties working) { for (String name : props.nameSet()) { SVNPropertyValue pv = props.getSVNPropertyValue(name); if (SVNProperty.isEntryProperty(name) && entry != null) { entry.put(name, pv); } else if (SVNProperty.isRegularProperty(name) && regular != null) { regular.put(name, pv); } else if (SVNProperty.isWorkingCopyProperty(name) && working != null) { working.put(name, pv); } } }
public static void addProperties(SVNAdminArea dir, String fileName, SVNProperties properties, boolean base, SVNLog log) throws SVNException { if (properties == null || properties.isEmpty()) { return; } SVNProperties regularProps = new SVNProperties(); SVNProperties entryProps = new SVNProperties(); SVNProperties wcProps = new SVNProperties(); for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { String propName = (String) names.next(); SVNPropertyValue propValue = properties.getSVNPropertyValue(propName); if (SVNProperty.isEntryProperty(propName)) { entryProps.put(SVNProperty.shortPropertyName(propName), propValue); } else if (SVNProperty.isWorkingCopyProperty(propName)) { wcProps.put(propName, propValue); } else { regularProps.put(propName, propValue); } } SVNVersionedProperties props = base ? dir.getBaseProperties(fileName) : dir.getProperties(fileName); props.removeAll(); for (Iterator propNames = regularProps.nameSet().iterator(); propNames.hasNext();) { String propName = (String) propNames.next(); SVNPropertyValue propValue = regularProps.getSVNPropertyValue(propName); props.setPropertyValue(propName, propValue); } dir.saveVersionedProperties(log, false); log.logChangedEntryProperties(fileName, entryProps); log.logChangedWCProperties(fileName, wcProps); }
public static void addProperties(SVNAdminArea dir, String fileName, SVNProperties properties, boolean base, SVNLog log) throws SVNException { if (properties == null || properties.isEmpty()) { return; } SVNProperties regularProps = new SVNProperties(); SVNProperties entryProps = new SVNProperties(); SVNProperties wcProps = new SVNProperties(); for (Iterator names = properties.nameSet().iterator(); names.hasNext();) { String propName = (String) names.next(); SVNPropertyValue propValue = properties.getSVNPropertyValue(propName); if (SVNProperty.isEntryProperty(propName)) { entryProps.put(SVNProperty.shortPropertyName(propName), propValue); } else if (SVNProperty.isWorkingCopyProperty(propName)) { wcProps.put(propName, propValue); } else { regularProps.put(propName, propValue); } } SVNVersionedProperties props = base ? dir.getBaseProperties(fileName) : dir.getProperties(fileName); props.removeAll(); for (Iterator propNames = regularProps.nameSet().iterator(); propNames.hasNext();) { String propName = (String) propNames.next(); SVNPropertyValue propValue = regularProps.getSVNPropertyValue(propName); props.setPropertyValue(propName, propValue); } dir.saveVersionedProperties(log, false); log.logChangedEntryProperties(fileName, entryProps); log.logChangedWCProperties(fileName, wcProps); }
public static void checkPropertyName(String propertyName, SVNPropertyValue propertyValue) throws SVNException { if (SVNRevisionProperty.isRevisionProperty(propertyName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_PROPERTY_NAME, "Revision property ''{0}'' not allowed in this context", propertyName); SVNErrorManager.error(err, SVNLogType.WC); } if (propertyValue != null && !SVNPropertiesManager.isValidPropertyName(propertyName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_PROPERTY_NAME, "Bad property name: ''{0}''", propertyName); SVNErrorManager.error(err, SVNLogType.WC); } if (SVNProperty.isWorkingCopyProperty(propertyName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_PROPERTY_NAME, "''{0}'' is a wcprop, thus not accessible to clients", propertyName); SVNErrorManager.error(err, SVNLogType.WC); } }
public void changeFileProperty(String path, String propertyName, SVNPropertyValue propertyValue) throws SVNException { if (SVNProperty.isRegularProperty(propertyName)) { if (regularPropChanges == null) { regularPropChanges = new SVNProperties(); } regularPropChanges.put(propertyName, propertyValue); } else if (SVNProperty.isEntryProperty(propertyName)) { if (entryPropChanges == null) { entryPropChanges = new SVNProperties(); } entryPropChanges.put(propertyName, propertyValue); } else if (SVNProperty.isWorkingCopyProperty(propertyName)) { if (davPropChanges == null) { davPropChanges = new SVNProperties(); } davPropChanges.put(propertyName, propertyValue); } }
public static SVNPropertyValue getProperty(SVNWCAccess access, File path, String propName) throws SVNException { SVNEntry entry = access.getEntry(path, false); if (entry == null) { return null; } String[] cachableProperties = entry.getCachableProperties(); if (cachableProperties != null && contains(cachableProperties, propName)) { String[] presentProperties = entry.getPresentProperties(); if (presentProperties == null || !contains(presentProperties, propName)) { return null; } if (SVNProperty.isBooleanProperty(propName)) { return SVNProperty.getValueOfBooleanProperty(propName); } } if (SVNProperty.isWorkingCopyProperty(propName)) { return getWCProperty(access, path, propName); } else if (SVNProperty.isEntryProperty(propName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROP_KIND, "Property ''{0}'' is an entry property", propName); SVNErrorManager.error(err, SVNLogType.DEFAULT); } SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); return dir.getProperties(entry.getName()).getPropertyValue(propName); }
public static SVNPropertyValue getProperty(SVNWCAccess access, File path, String propName) throws SVNException { SVNEntry entry = access.getEntry(path, false); if (entry == null) { return null; } String[] cachableProperties = entry.getCachableProperties(); if (cachableProperties != null && contains(cachableProperties, propName)) { String[] presentProperties = entry.getPresentProperties(); if (presentProperties == null || !contains(presentProperties, propName)) { return null; } if (SVNProperty.isBooleanProperty(propName)) { return SVNProperty.getValueOfBooleanProperty(propName); } } if (SVNProperty.isWorkingCopyProperty(propName)) { return getWCProperty(access, path, propName); } else if (SVNProperty.isEntryProperty(propName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROP_KIND, "Property ''{0}'' is an entry property", propName); SVNErrorManager.error(err, SVNLogType.DEFAULT); } SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); return dir.getProperties(entry.getName()).getPropertyValue(propName); }
public static String getProperty(SVNWCAccess access, File path, String propName) throws SVNException { SVNEntry entry = access.getEntry(path, false); if (entry == null) { return null; } String[] cachableProperties = entry.getCachableProperties(); if (cachableProperties != null && contains(cachableProperties, propName)) { String[] presentProperties = entry.getPresentProperties(); if (presentProperties == null || !contains(presentProperties, propName)) { return null; } if (SVNProperty.isBooleanProperty(propName)) { return SVNProperty.getValueOfBooleanProperty(propName); } } if (SVNProperty.isWorkingCopyProperty(propName)) { return getWCProperty(access, path, propName); } else if (SVNProperty.isEntryProperty(propName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROP_KIND, "Property ''{0}'' is an entry property", propName); SVNErrorManager.error(err); } SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); return dir.getProperties(entry.getName()).getPropertyValue(propName); }
public static SVNPropertyValue getProperty(SVNWCAccess access, File path, String propName) throws SVNException { SVNEntry entry = access.getEntry(path, false); if (entry == null) { return null; } String[] cachableProperties = entry.getCachableProperties(); if (cachableProperties != null && contains(cachableProperties, propName)) { String[] presentProperties = entry.getPresentProperties(); if (presentProperties == null || !contains(presentProperties, propName)) { return null; } if (SVNProperty.isBooleanProperty(propName)) { return SVNProperty.getValueOfBooleanProperty(propName); } } if (SVNProperty.isWorkingCopyProperty(propName)) { return getWCProperty(access, path, propName); } else if (SVNProperty.isEntryProperty(propName)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROP_KIND, "Property ''{0}'' is an entry property", propName); SVNErrorManager.error(err, SVNLogType.DEFAULT); } SVNAdminArea dir = entry.getKind() == SVNNodeKind.DIR ? access.retrieve(path) : access.retrieve(path.getParentFile()); return dir.getProperties(entry.getName()).getPropertyValue(propName); }