Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-359

It is possible to delete a ram://file (RamFileObject) while using a RandomAccessContent.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.1
    • Labels:
      None

      Description

      The fix is quite simple, adding a guard to RamFileObject.delete() fixes the problem. I have my own FileSystem abstract and its tests continue to pass. I thus assume running the tests for RamFileProvider will pass, thus this fix should not break anything.

      RamFileObject
      =============
      /*

      • (non-Javadoc)
      • @see org.apache.commons.vfs.provider.AbstractFileObject#doDelete()
        */
        @Override
        protected void doDelete() throws Exception
        Unknown macro: { // HACK inserted check to deny attempts to delete while reading/writing if (this.isContentOpen()) { throw new FileSystemException("open for reading/writing"); } this.fs.delete(this); }

      note HACK is my own marker that a chnage has been made to a third party *.java.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mp1 Miroslav Pokorny
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: