ALF-510 : errorOnOverwrite not implemented for overwriting files.

- now overwriting a file does result in an error if there is a pre-existing file.
  - also fixed deployment report to have the stack trace even if there is a deployment report.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19824 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-04-12 17:12:31 +00:00
parent b17f139fb0
commit d3816ad09b

View File

@@ -534,6 +534,7 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
if (report == null) if (report == null)
{ {
// There is no report
if (error == null) if (error == null)
{ {
writer.putContent(""); writer.putContent("");
@@ -549,7 +550,7 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
} }
else else
{ {
// TODO: revisit this, is it better to stream to a temp file? // There is a deployment report
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (DeploymentEvent event : report) for (DeploymentEvent event : report)
{ {
@@ -558,6 +559,18 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
builder.append(event.getDestination()); builder.append(event.getDestination());
builder.append("\r\n"); builder.append("\r\n");
} }
if(error != null)
{
builder.append("\r\n");
// add the full stack trace of the error as the content
StringWriter stack = new StringWriter();
PrintWriter stackPrint = new PrintWriter(stack);
error.printStackTrace(stackPrint);
builder.append(stack.toString());
}
writer.putContent(builder.toString()); writer.putContent(builder.toString());
} }