commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Semmens <lance.semm...@marketpipe.com>
Subject RE: using commons-vfs as webservice -newbie-
Date Tue, 09 Jan 2007 08:55:00 GMT
Have you tried:
FileSystemManager fsManager = VFS.getManager();
FileObject file = fsManager.resolveFile("file:///home/user/try1/file.pdf");

Instead of explicitly constructing a StandardFileSystemManager?

Im no VFS guru but this is how the VFS site recommends you get a FileSystemManager (http://jakarta.apache.org/commons/vfs/api.html)

-----Original Message-----
From: Ilaria Castelli [mailto:ilacastles@gmail.com] 
Sent: 08 January 2007 16:25
To: commons-user@jakarta.apache.org
Subject: using commons-vfs as webservice -newbie-

Hi,
I'm trying to develop a webservice using commons-vfs, Apache Tomcat and
Axis1.4.
First of all I wrote and tryed my method locally including the libraries
needed and everything's working.
Then I deployd this class on Axis:

import org.apache.commons.vfs.*;
import java.util.*;
public class VFSi {
   private FileSystemManager fsManager=new
org.apache.commons.vfs.impl.StandardFileSystemManager();
   public String Move(String From, String To) {...}
   public String Copy (String From, String To) {...}
   public String Delete (String Resource) {...}
}

I put in axis/WEB-INF/lib all the .jar needed, restarted tomcat, and wrote a
trial client to call methods:


      static final String svcURL = "
http://127.0.0.1:8180/axis/services/VFService";

      //.......definiton of fslist Vector - list of filesystems

      Service svc = new Service();
      Call call = (Call) svc.createCall();
      call.setTargetEndpointAddress(svcURL);
      call.setOperationName("Copy");
      String resp = (String) call.invoke (new Object[] {fslist.elementAt
(0).toString(),fslist.elementAt(6).toString()});

running the client I obtain this Exception:

 org.apache.commons.vfs.FileSystemException: Unknown scheme "file" in URI "
file:///home/user/try1/file.pdf"

and similar Exceptions using other filesystem types (ftp, smb) working
correctly locally but not once deployed.

Since i'm newbie, any help is welcome, thanks.


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


Mime
View raw message