lsvife -4 Junior Poster in Training

I created a website that will upload files to a webdav server
I can now upload files to the webdav server and I am able to view it.
below is my code

        boolean isMultiPart = FileUpload.isMultipartContent(request);
        DiskFileUpload upload = new DiskFileUpload();
        List items = upload.parseRequest(request);
        String baseUrl = "http://localhost:8084/webdavserver";
        Iterator itr = items.iterator();
        while (itr.hasNext()) {
            FileItem item = (FileItem);
                File fullFile = new File(item.getName());
                File savedFile = new File(getServletContext().getRealPath("/"),
                System.out.println("fullFile: "+fullFile);
                System.out.println("savedFile: "+savedFile);
                try {
                        HttpClient client = new HttpClient();
                        Credentials creds = new UsernamePasswordCredentials("myuser", "mypass");
                        client.getState().setCredentials(AuthScope.ANY, creds);

                        PutMethod method = new PutMethod(baseUrl + "/uploads/" + savedFile.getName());
                        System.out.println("path: "+fullFile);
                        RequestEntity requestEntity = new InputStreamRequestEntity( new FileInputStream(savedFile.getAbsolutePath()));
                        System.out.println("uploaded: "+method.getStatusCode() + " " + method.getStatusText());
                    } catch (HttpException e) {
                    } catch (IOException ex) {


I use tomcat as my server for webdav

How can I retrieve my uploaded files?

I noticed also that the files I uploaded are not on webdav repository so If I clean and build the server
all files are gone.

anybody can help me...
I am stuck on this for days.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.