public String getExtension ( String url ) { int dotIndex = url . lastIndexOf ( ' ' ) ; String extension = null ; if ( dotIndex > 0 ) { extension = url . substring ( dotIndex + 1 ) ; } return extension ; }
Gets the extension used in the URL if any .