Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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());
log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"+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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.