Hi Azon,
It seems there is a bug in our reading of the ATTACHMENT_DIRECTORY paramter. Could you please file a JIRA issue for that? We'll fix it for 1.2.3. Thanks!
- Dan

Azon wrote:
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.



--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog


---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to