#17 InputSource constructor for java.io.File

open-accepted
nobody
None
6
2014-08-14
2002-02-07
No

It would be useful to have a constructor in
org.xml.sax.InputSource which takes a java.io.File
argument. I guess the easiest way to implement it is
to immediately convert it into a systemId (a file:
URL).

Discussion

  • Anonymous - 2002-03-05

    Logged In: YES
    user_id=44117

    I could see this being useful; lots of folk seem to
    have problems understanding that filenames are not
    the same as the fully qualified URIs that need to
    be provided to SAX.

    I'll call this a candidate for a SAX 2.1 release.
    It's an API addition, with no complications for
    backwards compatibility. I'd write it up as two
    new methods:

    - constructor: public InputSource (java.io.File f)
    - setter: public void setSystemId (java.io.File f)

    Both would set the SYSTEM id to the fully qualified
    file: URL for that file. Implementation would use
    only JDK 1.1 methods (not File.toURL from JDK 1.2),
    and specification would stipulate that the method
    does not need to be provided (!) in environments
    that do not support java.io.File ... some of the
    smaller Java profiles (PJava and successors) don't
    require that class.

     
  • Anonymous - 2002-03-05
    • milestone: --> Next_Release_(example)
    • priority: 5 --> 6
     
  • Anonymous - 2002-03-05
    • status: open --> open-accepted
     

Log in to post a comment.