commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rami Ojares <>
Subject Re: [vfs] parsing uri
Date Tue, 29 Mar 2005 20:31:58 GMT
I glanced the tests you have in place for uris and naming
and they seem extensive. I am not going to test this extensively.

But the case that brought this issue up was like the following

I called
FileObject resolveFile(File baseFile, String name)
on FileSystemManager
and the baseFile has path something like
"/foo/%bar" and the name was just some ordinary
So just make sure you have this in your junit tests.

Anyway quickly trying the snapshot in my program brings
no errors.

By the way could you add the following to VFS

public static void close() {
    try {
        // Closes FileSystemManager instance
        final Method closeMethod = instance.getClass().getMethod(
            "close", null
        closeMethod.invoke(instance, null);
    catch (Exception e)
        // Ignore; don't close
    instance = null;

DefaultFileSystemManager already has the close method.
And this would be equal to the init method.
(I have some gc problems and this alleviates it a bit)

About the testing environment.
What exactly is needed to run the tests?
A quick quess would be
- ftp server
- sftp (ssh) server
- samba server
- tomcat for http & webdav

Why is uml or vmware needed?
The way I would test is to just have those servers
running on my machine.
Of course if something crashes vmware can bring security
but if none of the services run as root the setting should be secure enough.

I have never run the tests but I could try doing it.
It would be easy for me to set up those services on my gentoo.

Of course if you are planning on testing stuff on many platforms and
different server implementations then vmware would be needed but isn't that
an overkill? I mean how many different ftp servers are there?
And where do you draw the line. I am sure that you are not
going to test all ftp servers running on OS/400 using EBCDIC encoding :?)

If you could give a quick tutorial (that could be added then to docs) about 
how to run tests I could give it a shot. And I have even an XP on separate 
machine for smb testing.

And maybe there could be some kind of a profile where you tell what services
you have on for testing and where they can be found?

And now for some random thoughts:

It seems to my that currently the providers could be categorized into
4 categories:
- local filesystem
-  network protocol based providers
	- ftp, sftp, smb, webdav, http
- layered filesystems
	- tar, jar, bzip2, compressed, gzip, zip
- filesystems based on concepts from java environment
	- temp, url, res

I really have no deep understanding about this but please enlighten me where I 
am wrong.

- temp seems to have a special place because almost nothing is implemented
under temp package. So the implementation must be somewhere higher.
I assume that the implementation uses java's temporary file concept from API ???
- resources have a special place for a java program and earn their place
because of that.
- url provider bothers me because it kind of duplicates vfs. Basically it says
that you can access any url but the reality is that you can access only urls 
for which there exists a provider inside sun's jdk. The set of these 
providers is not part of the api and thus undocumented and subject to change 
any day. And do we find all those providers in other jdk's. And it DUPLICATES 
the effort of vfs (http, ftp, jar ...)

And then one question about layered filesystems.
Can you layer them as much as you like.
smb -> zip -> jar etc.

Time to go to sleep.

- rami

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message