Hi, Once Again.

I also admit to getting a bit frustrated, and just kluging in a webdav4j
example:

/*
 * Example 1: retrieve an outputstream for a given webdav resource:
 *OutputStream fileWriter = null;
 * try {
 *              // get a VirtualFileSystem Manager
 *      FileSystemManager fsManager = VFS.getManager();
 *      // retrieve the webdav resource
 *              WebdavFileObject resource
=(WebdavFileObject)fsManager.resolveFile(
"webdav://foo.bar/webdav/resource.txt" );
 *      // retrieve an output stream from that resource
 *              fileWriter = resource.getOutputStream();
 *              // use that output stream 
 *              // ...
 * } catch (Exception ex) {
 *                              throw ex;
 * } finally {
 *                      //close the stream at the end
 *                      if(fileWriter!=null)
 *                              fileWriter.close();
 * }
*/

As follows (in ConnectionDialog.java):

if ( uri.startsWith("webdav://") ) {
        WebdavFileObject resource =
(WebdavFileObject)VFSUtils.getFileSystemManager().resolveFile("webdav://
@http://altacsdev.am.corp.airliquide.com/webdav-test/OK.txt";);
      fileWriter = resource.getOutputStream();
else {
        fo = VFSUtils.resolveFileObject(uri);
}

And I still get:

Invalid absolute URI:
"webdav://@http://altacsdev.am.corp.airliquide.com/webdav-test/OK.txt".N
ull File Object!

I even tried without the OK.txt portion, with the "@" (even though I
know it is optional, I had put it in).

Any help would be greatly appreciated,
Theresa

-----Original Message-----
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Tuesday, April 27, 2010 1:17 PM
To: user@commons.apache.org
Subject: RE: [VFS] Trying To Use WebDAV


Guten Tag

on which container will you be implementing?

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
Diese Nachricht dient lediglich dem Austausch von Informationen und
entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt
uebernehmen.






> Subject: [VFS] Trying To Use WebDAV
> Date: Tue, 27 Apr 2010 11:49:35 -0700
> From: theresa.stewar...@airliquide.com
> To: user@commons.apache.org
> 
> Hi,
> 
>  
> 
> I was trying to use the following solution in order to obtain a
> FileObject using the WebDAV protocol (posted earlier on a thread):
> 
>  
> 
>  
> 
>         WebdavFileSystemConfigBuilder builder =
> 
>  
>
(WebdavFileSystemConfigBuilder)manager.getFileSystemConfigBuilder("webda
> v");
> 
>         final String uri = System.getProperty(TEST_URI);
> 
>         FileSystemOptions opts = new FileSystemOptions();
> 
>         builder.setRootURI(opts, uri);
> 
>         return manager.resolveFile(uri, opts);
> 
>  
> 
> and found out that builder.setRootURI(opts,uri); is not a choice on
> builder (not supported for the API I have).  Is there an alternative?
> 
>  
> 
> Is the TEST_URI the one constructed from:
> 
>  
> 
> Credentials credentials = credentialsBuilder.build();
> 
> String uri = credentials.toFileObjectURL();
> 
>  
> 
> Finally, how can the username and password be set?
> 
>  
> 
> Thanks,
> 
> Theresa
> 
>  
> 
                                          
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from
your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:
ON:WL:en-US:WM_HMP:042010_2

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

Reply via email to