Here you can find the source of getFileExtension(File file)
Parameter | Description |
---|---|
file | the file |
public static String getFileExtension(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from ww w . j a va 2s . c o m * Return the file extension. * @param file the file * @return The file extension. */ public static String getFileExtension(File file) { return file.getName().substring(file.getName().lastIndexOf(".") + 1); } }