Commons VFS
  1. Commons VFS
  2. VFS-11

[VFS] copyFrom keep the file with imaginary type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: Nightly Builds
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      If you copy a file to a file that did not exist using the FileObject.copyFrom
      method then the destination file is created but it's status is still imaginary.

      I had the problem when using the <v-copy> task to copy the content of war file
      to a file system with the keepladtmodifiedtime option. Because the file was
      still imaginary after the copy the SetLastModified method failed.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        777d 2h 15m 1 Henri Yandell 25/Mar/08 07:52
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s 1.0 Beta 2 [ 12311836 ]
        Henri Yandell made changes -
        Affects Version/s 1.0 Beta 2 [ 12311650 ]
        Key COM-2735 VFS-11
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Project Commons [ 12310458 ] Commons VFS [ 12310495 ]
        Component/s VFS [ 12311136 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38537 12342887
        Hide
        Mario Ivankovits added a comment -

        No Problem! I am happy you found it.

        Show
        Mario Ivankovits added a comment - No Problem! I am happy you found it.
        Hide
        Anthony Goubard added a comment -

        I did some more tests and at the end saw that this problem with the fact that I
        change the AbstractFileSystem.java to not put the imaginary files in the cache
        (I don't remember why I did it as it was a long time ago).

        Sorry for having submitted an invalid bug.

        Show
        Anthony Goubard added a comment - I did some more tests and at the end saw that this problem with the fact that I change the AbstractFileSystem.java to not put the imaginary files in the cache (I don't remember why I did it as it was a long time ago). Sorry for having submitted an invalid bug.
        Hide
        Mario Ivankovits added a comment -

        Hi!

        I tried to reproduce it with the following code snipped:

        FileObject existFile = VFS.getManager().resolveFile("/home/im/tmp/exists.txt");
        FileObject newFile = VFS.getManager().resolveFile("/home/im/tmp/new.txt");
        System.err.println("Exists:" + existFile.exists());
        System.err.println("New:" + newFile.exists());
        newFile.copyFrom(existFile, Selectors.SELECT_SELF);
        newFile.getContent().setLastModifiedTime(0L);
        System.err.println("Exists:" + existFile.exists());
        System.err.println("New:" + newFile.exists());

        and it worked as expected.
        Could you please try again. And maybe post the ant-task (only the v-copy stuff)

        Thanks!

        Show
        Mario Ivankovits added a comment - Hi! I tried to reproduce it with the following code snipped: FileObject existFile = VFS.getManager().resolveFile("/home/im/tmp/exists.txt"); FileObject newFile = VFS.getManager().resolveFile("/home/im/tmp/new.txt"); System.err.println("Exists:" + existFile.exists()); System.err.println("New:" + newFile.exists()); newFile.copyFrom(existFile, Selectors.SELECT_SELF); newFile.getContent().setLastModifiedTime(0L); System.err.println("Exists:" + existFile.exists()); System.err.println("New:" + newFile.exists()); and it worked as expected. Could you please try again. And maybe post the ant-task (only the v-copy stuff) Thanks!
        Hide
        Anthony Goubard added a comment -

        Created an attachment (id=17609)
        Fix of this bug

        I've fixed the problem by calling createFile() when the selector is
        SEFL_SELECTOR.

        Show
        Anthony Goubard added a comment - Created an attachment (id=17609) Fix of this bug I've fixed the problem by calling createFile() when the selector is SEFL_SELECTOR.
        Anthony Goubard created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Anthony Goubard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development