From 6d971fa3f358223de7a371a8daa4586d3ade4bd6 Mon Sep 17 00:00:00 2001 From: Athou Date: Sun, 31 Mar 2013 11:57:50 +0200 Subject: [PATCH] dependencies update --- pom.xml | 18 +++++++++++------- .../rest/resources/SubscriptionsREST.java | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index bdabba6c..332fbfb3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,10 @@ 0.0.1-SNAPSHOT war CommaFeed + + + 3.0.0 + UTF-8 @@ -44,7 +48,7 @@ maven-war-plugin - 2.1.1 + 2.3 false @@ -172,7 +176,7 @@ commons-fileupload commons-fileupload - 1.2.2 + 1.3 com.googlecode.lambdaj @@ -215,7 +219,7 @@ org.slf4j slf4j-simple - 1.7.4 + 1.7.5 @@ -237,7 +241,7 @@ org.jboss jboss-vfs - 3.0.1.GA + 3.1.0.Final de.agilecoders.wicket @@ -259,7 +263,7 @@ org.webjars angularjs - 1.0.5 + 1.1.3 org.webjars @@ -355,14 +359,14 @@ maven-surefire-plugin - 2.12 + 2.14 true maven-war-plugin - 2.1.1 + 2.3 deployments ROOT diff --git a/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java b/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java index 97edada2..4fa07dfd 100644 --- a/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java +++ b/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java @@ -119,13 +119,11 @@ public class SubscriptionsREST extends AbstractREST { @POST @Path("import") @Consumes(MediaType.MULTIPART_FORM_DATA) - @SuppressWarnings("unchecked") public Response importOpml() { try { FileItemFactory factory = new DiskFileItemFactory(1000000, null); ServletFileUpload upload = new ServletFileUpload(factory); - List items = upload.parseRequest(request); - for (FileItem item : items) { + for (FileItem item : upload.parseRequest(request)) { if ("file".equals(item.getFieldName())) { opmlImporter.importOpml(getUser(), IOUtils.toString(item.getInputStream(), "UTF-8")); @@ -133,7 +131,9 @@ public class SubscriptionsREST extends AbstractREST { } } } catch (Exception e) { - throw new RuntimeException(e.getMessage(), e); + throw new WebApplicationException(Response + .status(Status.INTERNAL_SERVER_ERROR) + .entity(e.getMessage()).build()); } return Response.ok(Status.OK).build(); }