Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4848096

MailcapCommandMap should store *ALL* mailcap entries

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.1
    • Component/s: other-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.1beta
    • CPU:
      x86
    • OS:
      windows_2000

      Description



      Name: bs11 Date: 04/14/2003


      FULL PRODUCT VERSION :
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Windows NT 5.0

      A DESCRIPTION OF THE PROBLEM :
      The documentation for this class says:
      # Note that mailcap entries that do not contain 'x-java' parameters
      # and comply to RFC 1524 are simply ignored:
      image/gif; /usr/dt/bin/sdtimage %s

      And it is indeed what it does. Unfortunately, real world Java applications need the information that is
      ignored w/o having to rewrite our own mailcap classes. The reason is that Java apps need to be able to
      run other programs to display different file types. E.g., PDF files, etc. We can maintain our own
      mailcap-like system, but the information is there already and already parsed by a Java class.

      If we could get the mailcap info, we need to be able to do something like
      CommandInfo.getCommandExecString(<text paramlist>) so we can launch the app.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      See description

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      MailcapCommandMap cmdMap = new MailcapCommandMap();
      CommandInfo[] cmds = cmdMap.getAllCommands("text/plain");
      System.out.println("numcmds: " + cmds.length);
      for (int i = 0; i < cmds.length; i++) {
      System.out.println(i + ") " + cmds[i].getCommandName() + " | " + cmds[i].getCommandClass());
      }

      You'll see that only x-java commands are listed.
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Write your own mailcap parser or call a native DLL or write your own mailcap clone.
      (Review ID: 178735)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              bshannon Bill Shannon (Inactive)
              Reporter:
              bshannon Bill Shannon (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: