Re: Finding the file extension before reading
Tuesday, August 8, 2006 04:00 AM
As far as Java is concearned, a zipfile and a textfile are just files with bytes in them. They just have a different meaning to different programs. Even when you have a text file, there is still the issue of the encoding, ie ASCII, EBCDIC, UTF8, UTF16, UTF32, the works... I would suggest you treat the file as what the extension tells it tobe, and just handle or throw any exception if things aren't going the way they are supposed to go...