Removing the extension from a filename
Your code can be improved in few lines:

        String fileName = file.getName();
        if (fileName.indexOf(".") &gt; 0)
            fileName = fileName.substring(0, fileName.lastIndexOf("."));
        return fileName;


As far as catching the exception, an advice, always catch the specific exception, not the generic, so you should be catching IOException or IndexOutOfBoundException instead of Exception. Also, it's always a good idea to log exception somehow.