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)
======================================================================
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)
======================================================================
- duplicates
-
JDK-8057113 (fs) Path should have a method to obtain the filename extension
- Resolved
- relates to
-
JDK-4313887 New I/O: Improved filesystem interface
- Resolved
-
JDK-8057113 (fs) Path should have a method to obtain the filename extension
- Resolved