public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient .get(MediaType.APPLICATION_XML); mailClient.put(mailRepresentation); mailRepresentation = mailClient.get(MediaType.APPLICATION_JSON); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource resource = new ClientResource("http://localhost:8113/"); resource.get().write(System.out); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); mailClient.get().write(System.out); }
public static void main(String[] args) throws Exception { ClientResource helloClientresource = new ClientResource( "http://localhost:8111/"); helloClientresource.get().write(System.out); } }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); mailClient.get().write(System.out); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource mailClient = new ClientResource( "http://localhost:8111/accounts/chunkylover53/mails/123"); Representation mailRepresentation = mailClient.get(); mailClient.put(mailRepresentation); }
public static void main(String[] args) throws Exception { ClientResource resource = new ClientResource("http://localhost:8111/"); // Get a representation Representation rep = resource.get(); // Display caching metadata System.out.println("Modified: " + rep.getModificationDate()); System.out.println("Expires: " + rep.getExpirationDate()); System.out.println("E-Tag: " + rep.getTag()); } }
public static void main(String[] args) throws Exception { ClientResource resource = new ClientResource("http://localhost:8111/"); // The Digester helps computing the digest while reading or writing the // representation's content. DigesterRepresentation rep = new DigesterRepresentation(resource.get()); rep.write(System.out); if (rep.checkDigest()) { System.out.println("\nContent checked."); } else { System.out.println("\nContent not checked."); } }
public static void main(String[] args) throws Exception { // Create the client resource ClientResource resource = new ClientResource("http://restlet.org"); // Customize the referrer property resource.setReferrerRef("http://www.mysite.org"); // Write the response entity on the console resource.get().write(System.out); }
private void getWctMetadata( SolrRecord solr ) { ClientResource cr = new ClientResource( WctRestletUrl + this.solr.getFieldValue( WctFields.WCT_INSTANCE_ID ) ); try { this.read( cr.get().getStream() ); } catch (ResourceException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
@Override public void challenge(Response response, boolean stale) { // Load the FreeMarker template Representation ftl = new ClientResource( LocalReference.createClapReference(getClass().getPackage()) + "/Login.ftl").get(); // Wraps the bean with a FreeMarker representation response.setEntity(new TemplateRepresentation(ftl, response .getRequest().getResourceRef(), MediaType.TEXT_HTML)); response.setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); }