jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-399

Remove the specification requirement to have a pre-packaged MessageBodyReader for File

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: ice box
    • Component/s: spec
    • Labels:
      None

      Description

      The specification requires supporting reading File objects out of the box.
      Proposal: drop this requirement as supporting it requires for the runtime to create a temporarily file on the disk for every request, and also copy the payload to the disk on every request. The implementations which already support reading File can continue to do so, this JIRA is really about not enforcing this requirement at the spec level.

        Activity

        Hide
        mkarg added a comment -

        Actually you can implement java.io.File subclasses which do not store anything on the local file System at all. I did this many times in the past as adapters between java.io.File based APIs and database-stored content. In fact, technically there is nothing in the java.io.File API which really enforces the use of a physical HDD-stored file.

        Show
        mkarg added a comment - Actually you can implement java.io.File subclasses which do not store anything on the local file System at all. I did this many times in the past as adapters between java.io.File based APIs and database-stored content. In fact, technically there is nothing in the java.io.File API which really enforces the use of a physical HDD-stored file.
        Hide
        beryozkin_sergey added a comment -

        Right, I've obviously have not done that before - so I'll take my comments off about having to save the data to the disk for now.

        What happens then if the user code calls File.toURI(), we don't have a guarantee that the user immediately calls "new FileInputStream(File)" or submits this File object immediately to some DB-aware layer ?

        Show
        beryozkin_sergey added a comment - Right, I've obviously have not done that before - so I'll take my comments off about having to save the data to the disk for now. What happens then if the user code calls File.toURI(), we don't have a guarantee that the user immediately calls "new FileInputStream(File)" or submits this File object immediately to some DB-aware layer ?

          People

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

            Dates

            • Created:
              Updated: