Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am downloading a .tif image from Firefox in Linux, and i look for the latest .tif file in the download folder:

File dir = new File(downloadDir.getDownloadDir());":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"+dir);FileFilter fileFilter = new WildcardFileFilter("*.tif");

File[] fileNames = dir.listFiles(fileFilter);
Arrays.sort(fileNames, LastModifiedFileComparator.LASTMODIFIED_REVERSE);
String fileMod = FileUtils.readFileToString(fileNames[0]);//getting arayindexoutofbounds

The above code works fine when run on Windows, but on Linux it gives the exception

ArrayIndexoutOfBoundsException on FileUtils.readFileToString(filenames[0]).

Is it the extension that it is not able to recognize?

share|improve this question
What exception and on what line of the code? – Jan Doggen Aug 21 '13 at 8:50
Hi Jan,I am getting ArrayIndexoutOfBoundsException on FileUtils.readFileToString(filenames[0]) – jeenie Aug 21 '13 at 9:05
Does the case match? Linux enforces case sensitivity on file names. – FatalError Aug 21 '13 at 14:00
I am passinng .tif.Just wanted to know,it should be TIFF ,TIF or simply tif – jeenie Aug 22 '13 at 5:25

You must log in to answer this question.

Browse other questions tagged .