Fix AWC-999: Content encoding is displayed and is settable in the UI.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6120 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-27 13:32:42 +00:00
parent 524faba1cd
commit dcca019090

View File

@@ -134,6 +134,26 @@ public class ContentData implements Serializable
return ret;
}
/**
* Constructs a new instance using the existing one as a template, but replacing the
* encoding.
*
* @param existing an existing set of content data, null to use default values
* @param encoding the encoding to set
* @return Returns a new, immutable instance of the data
*/
public static ContentData setEncoding(ContentData existing, String encoding)
{
ContentData ret = new ContentData(
existing == null ? null : existing.contentUrl,
existing == null ? null : existing.mimetype,
existing == null ? 0L : existing.size,
encoding,
existing == null ? null : existing.locale);
// done
return ret;
}
/**
* Create a content data using the {@link I18NUtil#getLocale() default locale}.
*