User (Legacy) Posted December 8, 2004 Report Share Posted December 8, 2004 If I attempt to import a chart using importChart(FileFormat format, String filePath) and I give importChart a completely bogus file (like a .gif for example), I will get the following error message in my log: [Fatal Error] :1:1: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at SoftwareFX.ChartFX.Internal.xvzv.ZZyz(Unknown Source) at SoftwareFX.ChartFX.yxyy.<init>(Unknown Source) at SoftwareFX.ChartFX._ChartCore.XXzW(Unknown Source) at SoftwareFX.ChartFX._ChartCore.yXzW(Unknown Source) at SoftwareFX.ChartFX.Chart.importChart(Unknown Source) But the method does not throw Throwable, Exception, or Error, so I cannot catch this error and attempt to rectify it. Is there any way I can test beforehand whether a file I attempt to import will work so that I can catch it and try something else? Thanks, Brendan Link to comment Share on other sites More sharing options...
Software FX Posted December 13, 2004 Report Share Posted December 13, 2004 This is an oversight and would be fixed pretty soon - Till then this is what you can try: if( new java.io.File("file-name").exists() ) import chart-- Thanks, am "Brendan O'Brien" <brendan.obrien@appiancorp.com> wrote in message news:qkfKz8X3EHA.1120@webserver3.softwarefx.com... > If I attempt to import a chart using importChart(FileFormat format, String > filePath) and I give importChart a completely bogus file (like a .gif for > example), I will get the following error message in my log: > > [Fatal Error] :1:1: Content is not allowed in prolog. > > org.xml.sax.SAXParseException: Content is not allowed in prolog. > > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) > > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) > > at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) > > at SoftwareFX.ChartFX.Internal.xvzv.ZZyz(Unknown Source) > > at SoftwareFX.ChartFX.yxyy.<init>(Unknown Source) > > at SoftwareFX.ChartFX._ChartCore.XXzW(Unknown Source) > > at SoftwareFX.ChartFX._ChartCore.yXzW(Unknown Source) > > at SoftwareFX.ChartFX.Chart.importChart(Unknown Source) > > But the method does not throw Throwable, Exception, or Error, so I cannot > catch this error and attempt to rectify it. Is there any way I can test > beforehand whether a file I attempt to import will work so that I can > catch > it and try something else? > > Thanks, > Brendan > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.