code: public static String[] splitFileName(String fileName) {
  	int pos = fileName.lastIndexOf('.');
  	if (pos == -1) {
  	    return new String[] { fileName };
  	}
  	return new String[] { fileName.substring(0, pos), fileName.substring(pos + 1) };
      }
docs: split a FileName in Parts
  
  @param fileName
  @return new String[]{name[,extension]}