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

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

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alanb Alan Bateman
                Reporter:
                vasya Vassili Igouchkine (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: