IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  Writing a WebDAV Client

    Posted Thu October 25, 2001 04:30 AM

    Hi,

    I am trying to write a WebDAV client using the http and Webdav librarys that come with Slide. I have the following code. This does create a file in the Webdav directory but the file size is Zero.

    String dest = getPath();
    String src = “c:/filetoupload.txt”;

    File file = new File(src);
    System.out.println(file.length());

    if (file.exists()) {
    System.out.print(“Uploading '” + src +
    “’ to '” + dest + “': “);
    if (webdavResource.putMethod(dest+”/filea.txt”, file)) {
    System.out.println(“succeeded.”);
    } else {
    System.err.println(“failed.”);
    System.err.println(
    webdavResource.getStatusMessage());
    }
    } else
    System.err.println
    (“Warning: File not exists”);


    Regards
    Pushparajan


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: Writing a WebDAV Client

    Posted Fri August 30, 2002 06:11 PM

    Hi Pushparajan,

    I 've the same problem with Slide WebDav Client.
    Did you find any solution for this problem?
    Thanks and regards,

    Esteban


    #webMethods
    #Tamino
    #API-Management


  • 3.  RE: Writing a WebDAV Client

    Posted Mon September 02, 2002 11:15 AM

    Hello,

    in our environment we were successful with following piece of code:


    String aFileName = ?A FILE NAME?;
    File input = new File(aFileName);
    if (!input.exists()) throw new Exception(“File " + aFileName + " does not exist”);
    method.setHeader(“Content-Length”, “”+input.length());
    method.sendData(input);



    Best regards

    Juergen


    #Tamino
    #API-Management
    #webMethods


  • 4.  RE: Writing a WebDAV Client

    Posted Mon September 02, 2002 06:36 PM

    Hi Juergen, thank you very much for your reply. I have solved the problem. I modified the Side.java . I changed the constructor of the File method.
    Best regards

    Code:

    //Change the src.indexOf
    if ((count == 2 && src.indexOf(“http:”) >=0) ||
    count == 1 && dest.indexOf(“:”) > 1)


    //Old!
    // File file = new File(dir.getCanonicalPath(), src);

    //New!!
    File file = new File(src);


    #API-Management
    #webMethods
    #Tamino