Hi,
I am developping a Web Service which allows upload and download of large
files. I enable MTOM and chunking.
I would like the attachment to be saved into a given directory and then
rename it. On the client side, I set the attachment directory parameter. But
it seems that the parameter is not taken into account. The attachment are
always created in the "tmp" directory. Find here after the client code :
public static void main(String[] args) {
try {
Properties props = new Properties();
props.setProperty("mtom-enabled", "true");
props.setProperty(HttpTransport.CHUNKING_ENABLED, "true");
Service serviceModel = new ObjectServiceFactory().create(
IFileTransferService.class, "FileTransfer",
"http://xfire.codehaus.org/FileTransfer", props);
serviceModel.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
File("C:\\downloads\\"));
serviceModel.setProperty(StreamedAttachments.ATTACHMENT_MEMORY_THRESHOLD,
new Integer(1000000000));
IFileTransferService service = (IFileTransferService) new
XFireProxyFactory()
.create(serviceModel,
"http://localhost:8080/FileTransferService/services/FileTransfer");
Client client = Client.getInstance(service);
// GET FILE
DataHandler dhIn = service.getFile("test.pdf");
AttachmentDataSource attSource = (AttachmentDataSource)
dhIn.getDataSource();
File attFile = attSource.getFile();
if (attFile != null)
attFile.renameTo(new
File(attFile.getParent()+"\\test.pdf"));
System.out.print("getFile OK");
return;
} catch (Exception e) {
e.printStackTrace();
}
}
Thanks for your help !
Antonino.
--
View this message in context:
http://www.nabble.com/MTOM-Web-Service-tf2473750.html#a6897778
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email