public String doExecute() throws Exception
{
InputStream is = null;
File renamedFile = null;
DigitalAssetVO digitalAssetVO = null;
try
{
MultiPartRequestWrapper mpr = ActionContext.getContext().getMultiPartRequest();
if(mpr != null)
{
String fromEncoding = CmsPropertyHandler.getUploadFromEncoding();
if(fromEncoding == null)
fromEncoding = "iso-8859-1";
String toEncoding = CmsPropertyHandler.getUploadToEncoding();
if(toEncoding == null)
toEncoding = "utf-8";
this.digitalAssetKey = new String(this.digitalAssetKey.getBytes(fromEncoding), toEncoding);
Enumeration names = mpr.getFileNames();
while (names.hasMoreElements())
{
String name = (String)names.nextElement();
String contentType = mpr.getContentType(name);
String fileSystemName = mpr.getFilesystemName(name);
File file = mpr.getFile(name);
String fileName = fileSystemName;
//String fileName = digitalAssetKey + "_" + System.currentTimeMillis() + "_" + fileSystemName;
//String tempFileName = "tmp_" + fileName;
//tempFileName = new VisualFormatter().replaceNonAscii(fileName, '_');
String filePath = CmsPropertyHandler.getDigitalAssetPath();
//fileSystemName = filePath + File.separator + tempFileName;
fileName = formatter.replaceNiceURINonAsciiWithSpecifiedChars(fileName, CmsPropertyHandler.getNiceURIDefaultReplacementCharacter());
if(file != null)
{
DigitalAssetVO newAsset = new DigitalAssetVO();
newAsset.setAssetContentType(contentType);
newAsset.setAssetKey(digitalAssetKey);
newAsset.setAssetFileName(fileName);
newAsset.setAssetFilePath(filePath);
newAsset.setAssetFileSize(new Integer(new Long(file.length()).intValue()));
//is = new FileInputStream(renamedFile);
is = new FileInputStream(file);
//DigitalAssetController.create(newAsset, is, this.contentVersionId);
//CreateContentWizardInfoBean createContentWizardInfoBean = this.getCreateContentWizardInfoBean();
//createContentWizardInfoBean.getDigitalAssets().put(digitalAssetKey + "_" + this.languageId, newAsset);