Commons VFS
  1. Commons VFS
  2. VFS-90

RandomAccessFile backed by a RandomAccessContent instance

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Labels:
      None

      Description

      Some existing libraries and applications rely on a RandomAccessFile instance to process its IO tasks.
      They could be benefited by an adapter class providing a "RandomAccessFile" view of an arbitrary RandomAccessContent.

      Example: a database server using a RandomAccessFile instance to access its data from a local file would automatically be able to access it from a remote resource accessed through HTTP.

      I have already created such a class. I'll try to add it to this issue.

      1. RACRandomAccessFile.java.bz2
        1 kB
        Elifarley Callado Coelho
      2. RACRandomAccessFile.java.bz2
        1 kB
        Elifarley Callado Coelho
      3. src.zip
        3 kB
        Elifarley Callado Coelho

        Activity

        Hide
        Mario Ivankovits added a comment -

        Same comment as on your other patch:

        Usage of org.ecc.base.* package names and too much other stuff you do at once.
        I think the RACRandomAccessFile.java can inherit from RandomAccessFile directly.

        Show
        Mario Ivankovits added a comment - Same comment as on your other patch: Usage of org.ecc.base.* package names and too much other stuff you do at once. I think the RACRandomAccessFile.java can inherit from RandomAccessFile directly.
        Hide
        Elifarley Callado Coelho added a comment -

        The attached class encapsulates a RandomAccessContent instance, allowing it to be used as a RandomAccessFile instance. It does not use any org.ecc.* class.

        Show
        Elifarley Callado Coelho added a comment - The attached class encapsulates a RandomAccessContent instance, allowing it to be used as a RandomAccessFile instance. It does not use any org.ecc.* class.
        Hide
        Mario Ivankovits added a comment -

        I had a look at this patch now, but I dont like the way how this needs to be done.

        I am aware why you need the temporary file, that we need to have it static and thus not thread safe and that we have to take care to delete the temporary file seems all too hacky.

        Unhappily I cant see another way how to workaround these things.

        Show
        Mario Ivankovits added a comment - I had a look at this patch now, but I dont like the way how this needs to be done. I am aware why you need the temporary file, that we need to have it static and thus not thread safe and that we have to take care to delete the temporary file seems all too hacky. Unhappily I cant see another way how to workaround these things.
        Hide
        Mario Ivankovits added a comment -

        As in preparation for a VFS release I close this issue as "Won't Fix" for now, but feel free to reopen/ping me if you've found another solution.
        Thanks anyway!

        Show
        Mario Ivankovits added a comment - As in preparation for a VFS release I close this issue as "Won't Fix" for now, but feel free to reopen/ping me if you've found another solution. Thanks anyway!
        Hide
        Elifarley Callado Coelho added a comment -

        I have removed the static field, so it's thread safe now.
        Please take a look at it again.

        Regards,
        Elifarley

        Show
        Elifarley Callado Coelho added a comment - I have removed the static field, so it's thread safe now. Please take a look at it again. Regards, Elifarley
        Hide
        Mario Ivankovits added a comment -

        Thanks! Will give it a try.

        Show
        Mario Ivankovits added a comment - Thanks! Will give it a try.
        Hide
        Mario Ivankovits added a comment -

        Added to the VFS sandbox.
        I slightly changed the read method, I think the (re)try stuff should be part of the application instead of VFS.
        A read len=0 might happen with virtually every read method ... even if unlikely.

        Thanks!
        Ciao,
        Mario

        Show
        Mario Ivankovits added a comment - Added to the VFS sandbox. I slightly changed the read method, I think the (re)try stuff should be part of the application instead of VFS. A read len=0 might happen with virtually every read method ... even if unlikely. Thanks! Ciao, Mario

          People

          • Assignee:
            Mario Ivankovits
            Reporter:
            Elifarley Callado Coelho
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development