posted 14 years ago
Hi Friends,
I am trying to upload file using Restlets but I am facing some issues, I am using following code
// Launching a Sever
Component component = new Component();
component.getServers().add(Protocol.HTTP, 8182);
component.getDefaultHost().attach("/essai",
new MyApplication(component.getContext()));
component.start();
/* Launches a simple client */
FileRepresentation rep = new FileRepresentation(
"d:\\temp\\test.txt", MediaType.TEXT_ALL, 0);
EncodeRepresentation encodedRep = new
EncodeRepresentation(Encoding.GZIP,
rep);
Client client = new Client(Protocol.HTTP);
Response response =
client.put("http://localhost:8182/essai/";, encodedRep);
System.out.println("******" + response.getStatus());
component.stop();
I am not getting that what I should written in MyApplication Class.
All king of help will be appreciated.
Thanks,
Navneet