Here you can find the source of getFileSimpleName(final File f)
Parameter | Description |
---|---|
f | The file |
public static String getFileSimpleName(final File f)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/* ww w . j a va 2 s . c o m*/ * Returns the simple file name (sans extension) for the passed file * @param f The file * @return the simple name */ public static String getFileSimpleName(final File f) { if (f == null) throw new RuntimeException("The passed file was null", new Throwable()); final String name = f.getName(); final int index = name.indexOf('.'); if (index == -1) return name; return name.substring(0, index); } }