tracker issue : CF-4207423

select a category, or use search below
(searches all categories and all time range)
Title:

File with colon in name breaks DirectoryList() and DirectoryDelete()

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Chris P. / ()

Created: 03/05/2020

Components: File Management, VFS-RAM

Versions: 2016,11.0,2018

Failure Type: Crash

Found In Build/Fixed In Build: 2016.0.13.316217 /

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Win 2016

Vote Count: 5

Problem Description: 

    If you write a file to a ram:/// directory with a colon ":" in the name, you will no longer be able to read/delete from that directory.

    In our case, we are using a ram directory with cfpop (as the documentation actually recommends). So, we are not controlling the files that are written to the drive. CF is choosing what to write and where. We used the recommended tool in the docs and now we have to restart CF. (Really, we are just going back to normal non-ram disk.)

Steps to Reproduce:

    * Write a file with a colon into a ram:/// directory - e.g. FileWrite(directory & "/cid:foo.txt", "");
    * Try to DirectoryList(directory, true) or DirectoryDelete(directory, true)

Actual Result:

    * error.code: vfs.provider/invalid-descendent-name.error
    * error.message: Invalid descendent file name "cid:foo.txt"
    * error.StackTrace: org.apache.commons.vfs2.FileSystemException: Invalid descendent file name "cid:foo.txt". at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveName(DefaultFileSystemManager.java:791)...

Expected Result:

    * If a file can be written to a directory, I can still list and delete the contents of that directory.

Any Workarounds:

    * Restart the CF server.

Attachments:

Comments:

Updating the commons-vfs2-2.0.jar to commons-vfs2-2.4.jar will resolve this specific issue, but would need to be tested for other functionality. I think CF2018 also uses the older 2.0 version.
Comment by Dave D.
33290 | March 19, 2020 08:55:13 PM GMT
commons-vfs2-2.5.0.jar also appears to work, but you need java8 for that.
Comment by Dave D.
33291 | March 19, 2020 09:32:54 PM GMT
After testing more, neither commons-vfs2-2.4.jar or commons-vfs2-2.5.0.jar will work with CF at this time. It resolves the : issue, but creates other issues.
Comment by Dave D.
33292 | March 19, 2020 10:45:55 PM GMT