commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Johansson <>
Subject Re: [vfs] Using VFS for FTP Access in Groovy
Date Thu, 24 Jan 2013 10:47:02 GMT
Gary & Mark - thanks for your input.

While checking out some of the things you suggested, it hit me where the
problem was.
That Groovy and/or Grails were involved had nothing to do with it the issue.

Turns out that for both vfs and vfs2, commons-net needs to be present on
the classpath
for FTP access to work. For people, unlike myself, who bother to read
before they fiddle arround with stuff, this might have been blatantly
obvious. :)

Without common-net, VFS appears to fail silently (and weirdly) by saying
that an FTP
folder is a file. By "silently" I mean that I see errors in the log with
the default configuration.
If I for example fail to include commons-httpclient, I would actually get a

So in my different projects, tests and setups this was the difference that
nothing else.

It's exactly the same for vfs2. Just replace the dependencies & imports.

On Wed, Jan 23, 2013 at 8:11 PM, Mark Fortner <> wrote:

> Do you have a runnable test for this?  I don't have access to an FTP server
> at the moment so I can't really test this, but I ran this code snippet
> against the local file system and it seemed to work properly:

This works fine for me as well, in all of the different setups. Local file
access was
never the issue.

Here's a gist of the vfs-version, you'll need an FTP to actually try it,
but the behavior
I've described can be observed by commenting out the @Grab-annotation that
in commons-net.

On Wed, Jan 23, 2013 at 8:23 PM, Gary Gregory <>

> You can get the package information for any Class object and query and
> print that: aClass.getPackage(), the Package has a bunch of APIs.

Now, this is a handy trick that goes straight down in my tool belt :)

In any case - problem solved - thanks for your input, guys!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message