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

File.{check,get,has}Extension() to access filename extension

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.1
    • core-libs
    • generic
    • generic

      Name: vi73552 Date: 03/26/99


      When dealing with files, it is occasionally necessary to
      look at the extension of a file. I think a very useful
      potential feature of java.io.File would be some methods
      that allow checking of a file extension. Some methods that
      would be most useful are:

      public String getExtension()
        // returns the file extension, or
        // null if there is not one

      public boolean hasExtension()
        // returns true if the file has an
        // extension of the format '.xxx'
        // and false if the file does not
        // have an extension.

      public boolean checkExtension( String E )
        // returns true if E (and only E) follows
        // the last period in the filename, returns
        // false if there is no extension or if E
        // doesn't match the extension
      (Review ID: 56140)
      ======================================================================

            bpb Brian Burkhalter
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: