JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-5775

[ruboto] Dir[] gives empty array when listing files below the root of the apk

    Details

    • Number of attachments :
      1

      Description

      Hi!

      I tried listing files with Dir[] in a subdirectory of the apk, and I only get an empty array. Listing files in the apk root works.

      This is pretty important, and would help a lot if fixed.

      Please tell me anything I can do to help fixing.

        Activity

        Hide
        Uwe Kubosch added a comment -

        Made an app which I think shows the problem.

        If you list the contents of the apk with

        jar tf bin/jruby_5775-debug.apk
        

        You will see files below "META-INF" and "res". I believe these should be listed when clicking the corresponding buttons in the app.

        Show
        Uwe Kubosch added a comment - Made an app which I think shows the problem. If you list the contents of the apk with jar tf bin/jruby_5775-debug.apk You will see files below "META-INF" and "res". I believe these should be listed when clicking the corresponding buttons in the app.
        Hide
        Uwe Kubosch added a comment -

        Anybody had a chance to look at this?

        Show
        Uwe Kubosch added a comment - Anybody had a chance to look at this?
        Hide
        Uwe Kubosch added a comment -

        I think I have tracked it down to JarFile.getEntry(dir) gives null for directories on Android.

        Doing JarFile.entries() lists all the files in the JAR, including the ones in the desired subdirectory. We could use this to filter what we want.

        Show
        Uwe Kubosch added a comment - I think I have tracked it down to JarFile.getEntry(dir) gives null for directories on Android. Doing JarFile.entries() lists all the files in the JAR, including the ones in the desired subdirectory. We could use this to filter what we want.
        Hide
        Uwe Kubosch added a comment -

        I do have a solution for our problem. It is a small implementation in RubyDir.java. It is pretty Ruboto specific, but I suspect you can generalize it to cover all JAR files.

        I'll do a pull request when I can sort out our fork. We will do a new fork as soon as the pending pull request is processed.

        Show
        Uwe Kubosch added a comment - I do have a solution for our problem. It is a small implementation in RubyDir.java. It is pretty Ruboto specific, but I suspect you can generalize it to cover all JAR files. I'll do a pull request when I can sort out our fork. We will do a new fork as soon as the pending pull request is processed.
        Hide
        Uwe Kubosch added a comment -
        Show
        Uwe Kubosch added a comment - Pull request added at https://github.com/jruby/jruby/pull/84
        Hide
        Yoko Harada added a comment -

        I merged pull requests in rev. 252ea7e on jruby-1_6 branch and 4f4bbe5 on master branch.

        Github repo will soon be updated with this change.

        If you (Uwe) think ok, please resolve this issue.

        Show
        Yoko Harada added a comment - I merged pull requests in rev. 252ea7e on jruby-1_6 branch and 4f4bbe5 on master branch. Github repo will soon be updated with this change. If you (Uwe) think ok, please resolve this issue.
        Hide
        Uwe Kubosch added a comment -

        Tested and confirmed. Resolving.

        Show
        Uwe Kubosch added a comment - Tested and confirmed. Resolving.

          People

          • Assignee:
            Unassigned
            Reporter:
            Uwe Kubosch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: