This is an automated email from the git hooks/post-receive script. New commit to branch feature/addPollenResourceApi in repository pollen. See http://git.chorem.org/pollen.git commit b40b5af4f5f13ecb21875e087dda5a5cd2d73f1c Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Jul 11 16:17:10 2014 +0200 delete tmp file --- pollen-persistence/src/main/xmi/pollen.properties | 1 - .../org/chorem/pollen/rest/api/v1/PollenResourceApi.java | 12 ++++++++++-- .../org/chorem/pollen/services/bean/ResourceFileBean.java | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pollen-persistence/src/main/xmi/pollen.properties b/pollen-persistence/src/main/xmi/pollen.properties index 7e82326..1a7496c 100644 --- a/pollen-persistence/src/main/xmi/pollen.properties +++ b/pollen-persistence/src/main/xmi/pollen.properties @@ -32,7 +32,6 @@ package.org.chorem.pollen.persistence.entity.stereotype=entity # Text org.chorem.pollen.persistence.entity.Poll.attribute.description.tagValue.hibernateAttributeType=text org.chorem.pollen.persistence.entity.Choice.attribute.description.tagValue.hibernateAttributeType=text -org.chorem.pollen.persistence.entity.Choice.attribute.choiceValue.tagValue.hibernateAttributeType=text org.chorem.pollen.persistence.entity.Comment.attribute.text.tagValue.hibernateAttributeType=text # Blob diff --git a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java index 7793994..7db0f32 100644 --- a/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java +++ b/pollen-rest-api/src/main/java/org/chorem/pollen/rest/api/v1/PollenResourceApi.java @@ -46,7 +46,11 @@ public class PollenResourceApi extends WebMotionController { resourceBean.setContentType(resource.getContentType()); resourceBean.setSize(resource.getSize()); - return pollenResourceService.createResource(resourceBean); + PollenEntityRef<PollenResource> createRef = pollenResourceService.createResource(resourceBean); + + resource.getFile().delete(); + + return createRef; } public PollenEntityRef<PollenResource> editResource(PollenResourceService pollenResourceService, PollenEntityId<PollenResource> resourceId, UploadFile resource) { @@ -58,7 +62,11 @@ public class PollenResourceApi extends WebMotionController { resourceBean.setContentType(resource.getContentType()); resourceBean.setSize(resource.getSize()); - return pollenResourceService.editResource(resourceId.getEntityId(), resourceBean); + PollenEntityRef<PollenResource> createRef = pollenResourceService.editResource(resourceId.getEntityId(), resourceBean); + + resource.getFile().delete(); + + return createRef; } diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java b/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java index c4c6498..5997c2e 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/bean/ResourceFileBean.java @@ -5,8 +5,10 @@ import org.chorem.pollen.persistence.entity.PollenResource; import org.chorem.pollen.persistence.entity.PollenResourceImpl; import javax.sql.rowset.serial.SerialBlob; -import javax.sql.rowset.serial.SerialException; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; import java.sql.Blob; import java.sql.SQLException; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm