on using the following line Document doc = new Document(inStream); with the file attached, an exception is thrown.
in thread "main" com.aspose.words.UnsupportedFileFormatException: Unknown file format. at com.aspose.words.Document.zzY(Unknown Source) at com.aspose.words.Document.zzZ(Unknown Source) at com.aspose.words.Document.(Unknown Source) at com.aspose.words.Document.(Unknown Source)
The same exception is thrown when a different file format like .pdf is used.
Is there a way in which we can find the get different exceptions for the two different scenarios. i.e if it any file format other than .docx or .doc it should give unsupportedfileformat and if the file is corrupted the it should mention that the file is corrupted.