protected void checkBooleanProperty(String name, SVNPropertyValue value) throws SVNException { if (!SVNProperty.isBooleanProperty(name)) { return; } String stringValue = value.getString().trim(); if ("".equals(stringValue) || "off".equalsIgnoreCase(stringValue) || "no".equalsIgnoreCase(stringValue) || "false".equalsIgnoreCase(stringValue)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROPERTY_VALUE, "To turn off the {0} property, use ''svn propdel'';\n" + "setting the property to ''{1}'' will not turn it off.", new Object[]{name, value}); getSVNEnvironment().handleWarning(err, new SVNErrorCode[]{SVNErrorCode.BAD_PROPERTY_VALUE}, getSVNEnvironment().isQuiet()); } } }
protected void checkBooleanProperty(String name, SVNPropertyValue value) throws SVNException { if (!SVNProperty.isBooleanProperty(name)) { return; } String stringValue = value.getString().trim(); if ("".equals(stringValue) || "off".equalsIgnoreCase(stringValue) || "no".equalsIgnoreCase(stringValue) || "false".equalsIgnoreCase(stringValue)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_PROPERTY_VALUE, "To turn off the {0} property, use ''svn propdel'';\n" + "setting the property to ''{1}'' will not turn it off.", new Object[]{name, value}); getSVNEnvironment().handleWarning(err, new SVNErrorCode[]{SVNErrorCode.BAD_PROPERTY_VALUE}, getSVNEnvironment().isQuiet()); } } }
public String getPropertyValue(String name) throws SVNException { if (getPropertiesMap() != null && getPropertiesMap().containsKey(name)) { return (String) getPropertiesMap().get(name); } SVNEntry entry = myAdminArea.getEntry(myEntryName, true); if (entry != null) { String[] cachableProps = entry.getCachableProperties(); if (cachableProps != null && getIndex(cachableProps, name) >= 0) { String[] presentProps = entry.getPresentProperties(); if (presentProps == null || getIndex(presentProps, name) < 0) { return null; } if (SVNProperty.isBooleanProperty(name)) { return SVNProperty.getValueOfBooleanProperty(name); } } } Map props = loadProperties(); if (!isEmpty()) { return (String)props.get(name); } return null; }
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 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 SVNPropertyValue getPropertyValue(String name) throws SVNException { if (getProperties() != null && getProperties().containsName(name)) { return getProperties().getSVNPropertyValue(name); } SVNEntry entry = myAdminArea.getEntry(myEntryName, true); if (entry != null) { String[] cachableProps = entry.getCachableProperties(); if (cachableProps != null && getIndex(cachableProps, name) >= 0) { String[] presentProps = entry.getPresentProperties(); if (presentProps == null || getIndex(presentProps, name) < 0) { return null; } if (SVNProperty.isBooleanProperty(name)) { return SVNProperty.getValueOfBooleanProperty(name); } } } SVNProperties props = loadProperties(); if (!isEmpty()) { return props.getSVNPropertyValue(name); } return null; }
public SVNPropertyValue getPropertyValue(String name) throws SVNException { if (getProperties() != null && getProperties().containsName(name)) { return getProperties().getSVNPropertyValue(name); } SVNEntry entry = myAdminArea.getEntry(myEntryName, true); if (entry != null) { String[] cachableProps = entry.getCachableProperties(); if (cachableProps != null && getIndex(cachableProps, name) >= 0) { String[] presentProps = entry.getPresentProperties(); if (presentProps == null || getIndex(presentProps, name) < 0) { return null; } if (SVNProperty.isBooleanProperty(name)) { return SVNProperty.getValueOfBooleanProperty(name); } } } SVNProperties props = loadProperties(); if (!isEmpty()) { return props.getSVNPropertyValue(name); } return null; }
public SVNPropertyValue getPropertyValue(String name) throws SVNException { if (getProperties() != null && getProperties().containsName(name)) { return getProperties().getSVNPropertyValue(name); } SVNEntry entry = myAdminArea.getEntry(myEntryName, true); if (entry != null) { String[] cachableProps = entry.getCachableProperties(); if (cachableProps != null && getIndex(cachableProps, name) >= 0) { String[] presentProps = entry.getPresentProperties(); if (presentProps == null || getIndex(presentProps, name) < 0) { return null; } if (SVNProperty.isBooleanProperty(name)) { return SVNProperty.getValueOfBooleanProperty(name); } } } SVNProperties props = loadProperties(); if (!isEmpty()) { return props.getSVNPropertyValue(name); } return null; }