Here you can find the source of truncateFileType(String p)
public static String truncateFileType(String p)
//package com.java2s; //License from project: Open Source License public class Main { public static String truncateFileType(String p) { int indexOfPeriod = p.lastIndexOf("."); if (indexOfPeriod < 0) return p; else {/*from w ww .j a va2s. c o m*/ return p.substring(0, indexOfPeriod); } } }