commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "L (JIRA)" <>
Subject [jira] [Commented] (VFS-558) java.lang.UnsupportedOperationException in FtpFileObject
Date Mon, 19 Jan 2015 18:25:35 GMT


L commented on VFS-558:

Re: Anyway, I fixed the rename in trunk, can you try?

Yes, it is fixed, thanks.

Re: I would use ON_RESOLVE or even MANUAL and then use refresh() in those particular places
where you want to have an up-to-date view of the children. Because with ON_CALL you cannot
control which of the methods actually need the refresh and which not. But: this should not
be related to your bug report, I just noticed it.

Since I was getting problems even with ON_CALL, I have added refresh() before checking if
a file exists, and it looks like it has solved spurious warnings. I cannot be 100% sure because
the warnings did not always occur when I have run my tests without refresh().

Re: BTW2: do you use OnCallRefresher on purpose, I can imagine that makes FTP quite slow.
Re: and really consider not using ON_CALL

This sounds intuitively as a correct piece of advice.

The thing is: my tests show different results:
I have a code that initializes an instance of  StandardFileSystemManager with a setCacheStrategy(CacheStrategy.ON_CALL)
before .init().

My tests accessing a local FS with setCacheStrategy(CacheStrategy.ON_CALL) commented out are
about 40% faster than with setCacheStrategy(CacheStrategy.ON_CALL) performed. As expected.

But FTP tests with ON_CALL are about the same 40% faster than with setCacheStrategy(CacheStrategy.ON_CALL)
commented out. Dare to explain?

> java.lang.UnsupportedOperationException in FtpFileObject
> --------------------------------------------------------
>                 Key: VFS-558
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: L
>            Assignee: Bernd Eckenfels
>             Fix For: 2.1
> I am getting the following exception in my code:
> java.lang.UnsupportedOperationException
> 	at java.util.Collections$UnmodifiableMap.remove(
> 	at org.apache.commons.vfs2.provider.ftp.FtpFileObject.onChildrenChanged(
> 	at org.apache.commons.vfs2.provider.AbstractFileObject.childrenChanged(
> 	at org.apache.commons.vfs2.provider.AbstractFileObject.notifyParent(
> 	at org.apache.commons.vfs2.provider.AbstractFileObject.handleCreate(
> 	at org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(
> 	at org.apache.commons.vfs2.impl.DecoratedFileObject.moveTo(
> 	at org.apache.commons.vfs2.cache.OnCallRefreshFileObject.moveTo(
> ...
> I guess it is caused by the fact that children field is set to EMPTY_FTP_FILE_MAP at
the moment onChildrenChanged() is invoked.
> I also do not like line 1866 in To me it looks like it might
be the real cause of the problem:
> FileObjectUtils.getAbstractFileObject(destFile).handleCreate(getType());
> Must it not be destFile.getType()?
> But even if I am right about, FtpFileObject.onChildrenChanged()
must be corrected as well.

This message was sent by Atlassian JIRA

View raw message