log.error("Expception getting channel size", e);
log.error("Exception getting channel size", e);
  public static final boolean containsPattern(String filename, String pattern) {    Logger log = CSMART.createLogger("org.coguaar.tools.csmart.FileParseUtil");    // Create the CharBuffer for the file.    FileInputStream iStream = null;    try {      iStream = new FileInputStream(ConfigFinder.getInstance().locateFile(filename));    } catch(IOException e) {      if(log.isErrorEnabled()) {        log.error("Exception finding file", e);      }    }    FileChannel channel = iStream.getChannel();    int length = 0;    try {      length = (int)channel.size();    } catch(IOException e) {      if(log.isErrorEnabled()) {        log.error("Expception getting channel size", e);      }    }    MappedByteBuffer buffer = null;    try {      buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, length);    } catch(IOException e) {      if(log.isErrorEnabled()) {        log.error("Exception creating buffer", e);      }    }    Charset charset = Charset.forName("ISO-8859-1");    CharsetDecoder decoder = charset.newDecoder();    CharBuffer cBuffer = null;    try {      cBuffer = decoder.decode(buffer);    } catch(CharacterCodingException cce) {      if(log.isErrorEnabled()) {        log.error("Exception decoding buffer", cce);      }    }        // Now search the CharBuffer using regex Patterns.    Pattern ptrn = Pattern.compile(pattern);    Matcher matcher = ptrn.matcher(cBuffer);    return matcher.find();  }