[jira] Created: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org
unable to browse hidden directories (regression fix overrode VFS-210:)
-----------------------------------------------------------------------

                 Key: VFS-288
                 URL: https://issues.apache.org/jira/browse/VFS-288
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.0
         Environment: java
            Reporter: Mark O'Donohue



The regression fix:

      r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line

      Fix unit test - throw exception if child is not a directory


Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:


      ------------------------------------------------------------------------
      r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line

      VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.


That allowed hidden directories to be listed.



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/VFS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark O'Donohue updated VFS-288:
-------------------------------

    Attachment: patch.diff

patch to allow FTP imaginary files to have children.



> unable to browse hidden directories (regression fix overrode VFS-210:)
> -----------------------------------------------------------------------
>
>                 Key: VFS-288
>                 URL: https://issues.apache.org/jira/browse/VFS-288
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: java
>            Reporter: Mark O'Donohue
>         Attachments: patch.diff
>
>
> The regression fix:
>       r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line
>       Fix unit test - throw exception if child is not a directory
> Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:
>       ------------------------------------------------------------------------
>       r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line
>       VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.
> That allowed hidden directories to be listed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/VFS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769576#action_12769576 ]

Mark O'Donohue commented on VFS-288:
------------------------------------

I have added a patch that seems to work,  getType() returns imaginary , if unknown so have just allowed direcories and imaginary files to have children.

> unable to browse hidden directories (regression fix overrode VFS-210:)
> -----------------------------------------------------------------------
>
>                 Key: VFS-288
>                 URL: https://issues.apache.org/jira/browse/VFS-288
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: java
>            Reporter: Mark O'Donohue
>         Attachments: patch.diff
>
>
> The regression fix:
>       r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line
>       Fix unit test - throw exception if child is not a directory
> Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:
>       ------------------------------------------------------------------------
>       r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line
>       VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.
> That allowed hidden directories to be listed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/VFS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774397#action_12774397 ]

Ralph Goers commented on VFS-288:
---------------------------------

I tried to apply this patch but when I ran FtpProviderTestCase it failed in ContentTests testChildren at line 182. That test seems to be explicitly checking that an exception gets thrown on an unknown file. The reason the change this issue references was made was because this unit test was failing. I didn't write the unit test and with test driven development I believe that that is the expected behavior. It would seem that the patch for VFS-210 was not tested against the existing unit tests.

I am not sure which behavior is "right" or "wrong", but I am hesitant to apply this without further discussion.

> unable to browse hidden directories (regression fix overrode VFS-210:)
> -----------------------------------------------------------------------
>
>                 Key: VFS-288
>                 URL: https://issues.apache.org/jira/browse/VFS-288
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: java
>            Reporter: Mark O'Donohue
>         Attachments: patch.diff
>
>
> The regression fix:
>       r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line
>       Fix unit test - throw exception if child is not a directory
> Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:
>       ------------------------------------------------------------------------
>       r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line
>       VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.
> That allowed hidden directories to be listed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/VFS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774474#action_12774474 ]

Mark O'Donohue commented on VFS-288:
------------------------------------

Hi Ralph

Yep, I understand I added the patch to my local copy only cause I needed it.

I also have a patch to let writing to hidden directories work, as that too has a similar problem.

I wonder if this needs to be put into a FTP options thing then, some setting to allow  IMAGINARY files to be treated as hidden directories.

That way it could pass the normal tests, but still allow a special mode for hidden directory operation.


FYI: Below is an additional  test I had to comment out to get writing to hidden directories to work.
                   in    method public OutputStream getOutputStream(boolean bAppend) throws FileSystemException

       what was happening was since it was imaginary, it was doing the whole recursive check parent thing.

      I did think first to overwrite :  getOutputStream(boolean bAppend) iin FtpFileObject.java but there seemed to be a pattern of:
      getOutputStream() -> doGetOutputStream and only the doGet was overwritten and the getXXX was not.

      If we were to go with put it as an option, how would you recommend i move that test out so i can overwrite it
      in the ftp specific one?

Cheers - Mark

--- AbstractFileObject.java     (revision 829303)
+++ AbstractFileObject.java     (working copy)
@@ -1381,6 +1381,7 @@
             throw new FileSystemException("vfs.provider/write-append-not-supported.error", name);
         }
 
+/*  MOD:::
         if (getType() == FileType.IMAGINARY)
         {
 // Does not exist - make sure parent does
@@ -1390,6 +1391,7 @@
                 parent.createFolder();
             }
         }
+*/
 
 // Get the raw output stream
         try


> unable to browse hidden directories (regression fix overrode VFS-210:)
> -----------------------------------------------------------------------
>
>                 Key: VFS-288
>                 URL: https://issues.apache.org/jira/browse/VFS-288
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: java
>            Reporter: Mark O'Donohue
>         Attachments: patch.diff
>
>
> The regression fix:
>       r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line
>       Fix unit test - throw exception if child is not a directory
> Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:
>       ------------------------------------------------------------------------
>       r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line
>       VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.
> That allowed hidden directories to be listed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (VFS-288) unable to browse hidden directories (regression fix overrode VFS-210:)

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/VFS-288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774496#action_12774496 ]

Ralph Goers commented on VFS-288:
---------------------------------

I don't like the idea that the behavior should be specific to any particular provider. Actually, I would prefer if the FileType could be HIDDEN for these files instead of IMAGINARY. The problem with the change above is that if the parent directory really doesn't exist it needs to be created. Can you see if there is some way that could be done?

> unable to browse hidden directories (regression fix overrode VFS-210:)
> -----------------------------------------------------------------------
>
>                 Key: VFS-288
>                 URL: https://issues.apache.org/jira/browse/VFS-288
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: java
>            Reporter: Mark O'Donohue
>         Attachments: patch.diff
>
>
> The regression fix:
>       r742127 | rgoers | 2009-02-09 03:37:32 +1100 (Mon, 09 Feb 2009) | 1 line
>       Fix unit test - throw exception if child is not a directory
> Now means that FTP hidden directories cannot be listed, since the getType() has to return a DIRECTORY value.  The overwrote the earlier change:
>       ------------------------------------------------------------------------
>       r659785 | imario | 2008-05-24 20:32:41 +1000 (Sat, 24 May 2008) | 1 line
>       VFS-210: First development iteration. Most important methods now work more like a wrapper,    you should already see a major increase in performance with ftp and large directories as long as no method (or your code) calls getFileType(). Hidden and special files should work now too .. as long as you know the path, for sure.
> That allowed hidden directories to be listed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.