SVNFileUtil.closeFile(is);
}
}
public boolean fileIsBinary() throws SVNException {
SVNPropertyValue mimeType = getProperty(access, path, SVNProperty.MIME_TYPE);
return mimeType != null && SVNProperty.isBinaryMimeType(mimeType.getString());
}
});
}
if (entry.getKind() == SVNNodeKind.FILE && SVNProperty.EXECUTABLE.equals(propName)) {
if (propValue == null) {
SVNFileUtil.setExecutable(path, false);
} else {
propValue = SVNProperty.getValueOfBooleanProperty(propName);
SVNFileUtil.setExecutable(path, true);
}
}
if (entry.getKind() == SVNNodeKind.FILE && SVNProperty.NEEDS_LOCK.equals(propName)) {
if (propValue == null) {
SVNFileUtil.setReadonly(path, false);
} else {
propValue = SVNProperty.getValueOfBooleanProperty(propName);
}
}
SVNVersionedProperties properties = dir.getProperties(entry.getName());
SVNPropertyValue oldValue = properties.getPropertyValue(propName);
SVNEventAction action;
if (oldValue == null) {
if (propValue == null) {
action = SVNEventAction.PROPERTY_DELETE_NONEXISTENT;
} else {
action = SVNEventAction.PROPERTY_ADD;
}
} else {
if (propValue == null) {
action = SVNEventAction.PROPERTY_DELETE;
} else {
action = SVNEventAction.PROPERTY_MODIFY;
}
}
if (!updateTimeStamp && (entry.getKind() == SVNNodeKind.FILE && SVNProperty.KEYWORDS.equals(propName))) {
Collection oldKeywords = getKeywords(oldValue == null ? null : oldValue.getString());
Collection newKeywords = getKeywords(propValue == null ? null : propValue.getString());
updateTimeStamp = !oldKeywords.equals(newKeywords);
}
SVNLog log = dir.getLog();
if (updateTimeStamp) {
SVNProperties command = new SVNProperties();
command.put(SVNLog.NAME_ATTR, entry.getName());
command.put(SVNProperty.shortPropertyName(SVNProperty.TEXT_TIME), (String) null);
log.addCommand(SVNLog.MODIFY_ENTRY, command, false);
}
properties.setPropertyValue(propName, propValue);
dir.saveVersionedProperties(log, false);
log.save();
dir.runLogs();
final boolean modified = oldValue == null ? propValue != null : !oldValue.equals(propValue);
if (modified || action == SVNEventAction.PROPERTY_DELETE_NONEXISTENT) {
dir.getWCAccess().handleEvent(new SVNEvent(path, entry.getKind(), null, -1, null, null, null, null, action, action, null, null, null));
}
return modified;
}