public static Map computeAutoProperties(ISVNOptions options, File file) { Map properties = options.applyAutoProperties(file, null); if (!properties.containsKey(SVNProperty.MIME_TYPE)) { String mimeType = SVNFileUtil.detectMimeType(file); if (mimeType != null) { properties.put(SVNProperty.MIME_TYPE, mimeType); } } if (SVNProperty.isBinaryMimeType((String) properties.get(SVNProperty.MIME_TYPE))) { properties.remove(SVNProperty.EOL_STYLE); } if (!properties.containsKey(SVNProperty.EXECUTABLE)) { if (SVNFileUtil.isExecutable(file)) { properties.put(SVNProperty.EXECUTABLE, SVNProperty.getValueOfBooleanProperty(SVNProperty.EXECUTABLE)); } } return properties; }
private void addFile(File path, SVNFileType type, SVNAdminArea dir) throws SVNException { SVNWCManager.add(path, dir, null, SVNRevision.UNDEFINED); String mimeType = null; if (type == SVNFileType.SYMLINK) { SVNPropertiesManager.setProperty(dir.getWCAccess(), path, SVNProperty.SPECIAL, SVNProperty.getValueOfBooleanProperty(SVNProperty.SPECIAL), false); } else { Map props = SVNPropertiesManager.computeAutoProperties(getOptions(), path); for (Iterator names = props.keySet().iterator(); names.hasNext();) { String propName = (String) names.next(); String propValue = (String) props.get(propName); SVNPropertiesManager.setProperty(dir.getWCAccess(), path, propName, propValue, false); } mimeType = (String) props.get(SVNProperty.MIME_TYPE); } SVNEvent event = SVNEventFactory.createAddedEvent(dir, path.getName(), SVNNodeKind.FILE, mimeType); dispatchEvent(event); }
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; }
SVNFileUtil.setExecutable(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName); SVNFileUtil.setExecutable(path, true); SVNFileUtil.setReadonly(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName);
if (type == SVNFileType.SYMLINK) { SVNPropertiesManager.setProperty(dir.getWCAccess(), path, SVNProperty.SPECIAL, SVNProperty.getValueOfBooleanProperty(SVNProperty.SPECIAL), false); } else { Map props = SVNPropertiesManager.computeAutoProperties(getOptions(), path, null);
String mimeType = null; if (type == SVNFileType.SYMLINK) { SVNPropertiesManager.setProperty(dir.getWCAccess(), path, SVNProperty.SPECIAL, SVNProperty.getValueOfBooleanProperty(SVNProperty.SPECIAL), false); } else { Map props = SVNPropertiesManager.computeAutoProperties(getOptions(), path, null);
if (type == SVNFileType.SYMLINK) { SVNPropertiesManager.setProperty(dir.getWCAccess(), path, SVNProperty.SPECIAL, SVNProperty.getValueOfBooleanProperty(SVNProperty.SPECIAL), false); } else { Map props = SVNPropertiesManager.computeAutoProperties(getOptions(), path, null);
SVNFileUtil.setExecutable(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName); SVNFileUtil.setExecutable(path, true); SVNFileUtil.setReadonly(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(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 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); }
SVNFileUtil.setExecutable(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName); SVNFileUtil.setExecutable(path, true); SVNFileUtil.setReadonly(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName);
SVNFileUtil.setExecutable(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(propName); SVNFileUtil.setExecutable(path, true); SVNFileUtil.setReadonly(path, false); } else { propValue = SVNProperty.getValueOfBooleanProperty(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; }