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

[vfs] ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      34817

      Description

      Hi,

      An abusive class cast cause a ClassCastException in
      org.apache.commons.vfs.provider.AbstractFileObject#copyFrom( FileObject file,
      FileSelector selector )

      This occurs while passing a FileObject instance that is not a AbstractFileObject
      Snippet code in fault :
      // Locate the files to copy across
      final ArrayList files = new ArrayList();
      ((AbstractFileObject) file).findFiles(selector, false, files);
      Correct code (suggestion) :
      final List files = Arrays.asList( file.findFiles( selector ) );
      I use the above code in the FileObject supplied by my provider, but it should be
      corrected in org.apache.commons.vfs.provider.AbstractFileObject

      I'm developping a provider for XML:DB bound to the "xmldb" scheme.
      (if you want to, I'll give you the entire code when it will be done)

      Regards,
      Philippe Poulard

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              philippe.poulard@inria.fr Philippe Poulard
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: