提交 5248651d 编写于 作者: T Tijs Rademakers

Fix for REST deployment multipart

上级 4bdddb6a
......@@ -151,7 +151,7 @@ public class TimerDeclarationImpl implements Serializable {
// See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself
boolean repeat = !isInterruptingTimer;
// ACT-1951: intermediate catching timer events shouldn't repeat accoring to spec
// ACT-1951: intermediate catching timer events shouldn't repeat according to spec
if(TimerCatchIntermediateEventJobHandler.TYPE.equals(jobHandlerType)) {
repeat = false;
}
......
......@@ -30,6 +30,7 @@ import org.activiti.engine.repository.DeploymentBuilder;
import org.activiti.engine.repository.DeploymentQuery;
import org.activiti.rest.common.api.DataResponse;
import org.activiti.rest.service.api.RestResponseFactory;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -116,7 +117,14 @@ public class DeploymentCollectionResource {
try {
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
String fileName = file.getName();
String fileName = file.getOriginalFilename();
if (StringUtils.isEmpty(fileName) || !(
fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn") ||
fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip"))) {
fileName = file.getName();
}
if (fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn")) {
deploymentBuilder.addInputStream(fileName, file.getInputStream());
} else if (fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip")) {
......
......@@ -13,7 +13,6 @@ import org.activiti.rest.service.BaseSpringRestTestCase;
import org.activiti.rest.service.HttpMultipartHelper;
import org.activiti.rest.service.api.RestUrls;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册