mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-2363 - Fix to Alfresco Explorer to immediatly clean up temp files after upload to repo.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19850 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -194,7 +194,7 @@ public class FileUploadBean implements Serializable
|
|||||||
ContentWriter writer = services.getContentService().getWriter(fileNodeRef, ContentModel.PROP_CONTENT, true);
|
ContentWriter writer = services.getContentService().getWriter(fileNodeRef, ContentModel.PROP_CONTENT, true);
|
||||||
writer.setMimetype(mimetype);
|
writer.setMimetype(mimetype);
|
||||||
writer.setEncoding(encoding);
|
writer.setEncoding(encoding);
|
||||||
writer.putContent(file);
|
writer.putContent(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -202,6 +202,15 @@ public class FileUploadBean implements Serializable
|
|||||||
{
|
{
|
||||||
returnPage = returnPage.replace("${UPLOAD_ERROR}", e.getMessage());
|
returnPage = returnPage.replace("${UPLOAD_ERROR}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if(file != null)
|
||||||
|
{
|
||||||
|
logger.debug("delete temporary file:" + file.getPath());
|
||||||
|
// Delete the temporary file
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Document result = XMLUtil.newDocument();
|
Document result = XMLUtil.newDocument();
|
||||||
Element htmlEl = result.createElement("html");
|
Element htmlEl = result.createElement("html");
|
||||||
@@ -216,8 +225,9 @@ public class FileUploadBean implements Serializable
|
|||||||
scriptEl.appendChild(scriptText);
|
scriptEl.appendChild(scriptText);
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
logger.debug("File upload request complete.");
|
logger.debug("File upload request complete.");
|
||||||
|
}
|
||||||
ResponseWriter out = fc.getResponseWriter();
|
ResponseWriter out = fc.getResponseWriter();
|
||||||
XMLUtil.print(result, out);
|
XMLUtil.print(result, out);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user