try { firstLine = attributes.errorLocation.line - attributes.showcontext; lastLine = attributes.errorLocation.line + attributes.showcontext; //create an instance of VFSFileFactory to fetch the intputstream vfsfilefactory = createObject("java", "coldfusion.vfs.VFSFileFactory"); //get the input stream for the file inputStream = vfsfilefactory.getInputStream(attributes.errorLocation.Template); // Wrap a InputStreamReader in a LineNumberReader to read the CFML template as text. inputStreamReaderClass = createObject("java", "java.io.InputStreamReader"); inputStreamReader = inputStreamReaderClass.init(inputStream); lineReaderClass = createObject("java", "java.io.LineNumberReader" ); lineReader = lineReaderClass.init(inputStreamReader); currentLine = lineReader.readLine(); while ( isDefined("currentLine") and lineReader.getLineNumber() lte lastLine ) { if ( lineReader.getLineNumber() gte firstLine ) { lineInfoStruct = structNew(); lineInfoStruct.line = currentLine; lineInfoStruct.lineNumber = lineReader.getLineNumber(); ArrayAppend(result, lineInfoStruct); } currentLine = lineReader.readLine(); } } catch ( "Any" ex) { lineInfoStruct = structNew(); lineInfoStruct.line = s_unable; lineInfoStruct.lineNumber = -1; lineInfoStruct.diagnostic = ex; ArrayAppend(result, lineInfoStruct); } finally { if(isDefined("lineReader")) { lineReader.close(); } }