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 Sun, 18 Jan 2015 20:18:34 GMT


L commented on VFS-558:

Re: BTW2: do you use OnCallRefresher on purpose, I can imagine that makes FTP quite slow.

Well, I do use CacheStrategy.ON_CALL, so yes, it is OnCallRefreshFileObject.
My code has some checks before performing moveTo to verify the destination file is not there
so I am not overwriting it.
My tests gave me quite a lot of spurious warnings saying the file IS there before the rename
while I quite sure it was not there.
Adding the CacheStrategy.ON_CALL helped a lot but sometimes I still get resulted in most of
the false positive 

> java.lang.UnsupportedOperationException in FtpFileObject
> --------------------------------------------------------
>                 Key: VFS-558
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: L
> 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