public RepositoryObject createOldObject(
ActivatedVariablePolicy policy, Variant variant,
InternalDevice device) {
// Convert the variant into an asset.
ScriptMetaData metaData = (ScriptMetaData) variant.getMetaData();
ScriptAsset asset = new ScriptAsset();
setAssetIdentity(policy, asset);
final ScriptEncoding scriptEncoding = metaData.getScriptEncoding();
if (scriptEncoding != null) {
asset.setProgrammingLanguage((String) ENCODING.get(scriptEncoding));
// use the first mime type if there is any
final Iterator iter = scriptEncoding.mimeTypes();
if (iter.hasNext()) {
asset.setMimeType((String) iter.next());
}
}
asset.setCharacterSet(metaData.getCharacterSet());
setValue(asset, variant);
return asset;
}