Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Fixed compilation error in book examples

  • Loading branch information...
commit 8e2454d26d76294c684ba99ace20c00793eb726a 1 parent 22d9d9f
@jlouvel jlouvel authored
View
7 modules/org.restlet.example/src/org/restlet/example/book/restlet/ch04/sec5/sub2/MailServerResource.java
@@ -33,8 +33,6 @@
package org.restlet.example.book.restlet.ch04.sec5.sub2;
-import java.io.IOException;
-
import org.restlet.data.MediaType;
import org.restlet.data.Reference;
import org.restlet.ext.jackson.JacksonRepresentation;
@@ -90,8 +88,7 @@ protected Representation put(Representation representation, Variant variant)
if (MediaType.APPLICATION_XML.isCompatible(representation
.getMediaType())) {
// Parse the XML representation to get the mail bean
- mail = new XstreamRepresentation<Mail>(representation,
- Mail.class).getObject();
+ mail = new XstreamRepresentation<Mail>(representation).getObject();
System.out.println("XML representation received");
} else if (MediaType.APPLICATION_JSON.isCompatible(representation
.getMediaType())) {
@@ -109,7 +106,7 @@ protected Representation put(Representation representation, Variant variant)
System.out.println("Account URI: " + mail.getAccountRef());
System.out.println();
}
- } catch (IOException e) {
+ } catch (Exception e) {
throw new ResourceException(e);
}
Please sign in to comment.
Something went wrong with that request. Please try again.