/** Whether to insert the file. */
private boolean insert;
+ /** The default content type of this entry. */
+ private String defaultContentType;
+
/** The content type of the file. */
private String contentType;
* {@inheritDoc}
*/
public boolean isDefault() {
- return (insert == defaultInsert) && (contentType == null);
+ return (insert == defaultInsert) && isDefaultContentType();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isDefaultContentType() {
+ return ((defaultContentType != null) ? defaultContentType.equals(contentType) : (contentType == null));
}
/**
fireIfPropertyChanged(PROPERTY_CONTENT_TYPE, oldContentType, contentType);
}
+ /**
+ * Sets the default content type of the entry. The default content type is
+ * derived from its extension.
+ *
+ * @param defaultContentType
+ * The default content type
+ */
+ void setDefaultContentType(String defaultContentType) {
+ this.defaultContentType = defaultContentType;
+ }
+
}