strip Extension name : FilenameFilter « File « Java Tutorial


public class Main {


   * org/my/ -> org/my/Class
  public static String stripExtension( final String pResourceName ) {
      final int i = pResourceName.lastIndexOf('.');
      if (i < 0) {
          return pResourceName;
      final String withoutExtension = pResourceName.substring(0, i);
      return withoutExtension;

11.71.1.Combine FilenameFilter and Pattern match to create a dir command
11.71.2.A prefix based filename filter
11.71.3.Filter files by name
11.71.4.strip Extension name
11.71.5.A filesystem filter.
11.71.6.File filter: retrieve at most predefined number of files which are older than specified data