commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Cooke" <Tony.Co...@elders.com.au>
Subject RE: [commons vfs] ftp DefaultFileMonitor issue
Date Thu, 06 Jul 2006 07:00:21 GMT
Hi again.

OK. I read the wiki but determined before that, it's a caching issue.

Now instead of using the default:

  FileSystemManager mgr = VFS.getManager();

I'm using:

  DefaultFileSystemManager mgr = new DefaultFileSystemManager();
  mgr.addProvider("res", new ResourceFileProvider());
  mgr.addProvider("ftp", new FtpFileProvider());
  mgr.setCacheStrategy(CacheStrategy.ON_CALL);
  mgr.init();

Unfortunately I get the following error:

2006-07-06 16:10:24,675 DEBUG [main] (SoftRefFilesCache.java:143)
putFile:
ftp://user:password@ftp.theweather.com.au/elders/twc_fcast_local_aus.xml
2006-07-06 16:10:24,706 DEBUG [main] (SoftRefFilesCache.java:143)
putFile: ftp://user:password @ftp.theweather.com.au/
2006-07-06 16:10:24,722 DEBUG [main] (SoftRefFilesCache.java:143)
putFile: ftp://user:password@ftp.theweather.com.au/elders
2006-07-06 16:10:24,738 ERROR [main] (DefaultFileMonitor.java:195) Could
not determine the type of file
"ftp://user:password@ftp.theweather.com.au/elders/twc_obs_current_aws_au
s.xml".
org.apache.commons.vfs.FileSystemException: Could not determine the type
of file
"ftp://user:password@ftp.theweather.com.au/elders/twc_obs_current_aws_au
s.xml".
	at
org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileOb
ject.java:1277)
	at
org.apache.commons.vfs.provider.AbstractFileObject.getType(AbstractFileO
bject.java:409)
	at
org.apache.commons.vfs.impl.DecoratedFileObject.getType(DecoratedFileObj
ect.java:129)
	at
org.apache.commons.vfs.cache.OnCallRefreshFileObject.getType(OnCallRefre
shFileObject.java:116)
	at
org.apache.commons.vfs.impl.DefaultFileMonitor.addFile(DefaultFileMonito
r.java:182)
	at TestFileMonitor.main(TestFileMonitor.java:51)
Caused by: java.lang.ClassCastException:
org.apache.commons.vfs.cache.OnCallRefreshFileObject
	at
org.apache.commons.vfs.provider.ftp.FtpFileObject.getInfo(FtpFileObject.
java:173)
	at
org.apache.commons.vfs.provider.ftp.FtpFileObject.doAttach(FtpFileObject
.java:165)
	at
org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileOb
ject.java:1263)
	... 5 more

So it " Could not determine the type of file ". 

I don't understand why though.

Thanks in advance for any help anyone can offer.

All the best,
Tony


---------------------------------------------------------------------
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