code: private int scrollToFileEnd() {
  
          int lines = 0;
          if (OpenCms.getRunLevel() < OpenCms.RUNLEVEL_3_SHELL_ACCESS) {
              // no scrolling if system not yet fully initialized
          } else {
              LineNumberReader reader = null;
              // shift the window position to the end of the file: this is expensive but OK for ocs logfiles as they
              // are ltd. to 2 MB
              try {
                  reader = new LineNumberReader(
                      new BufferedReader(new InputStreamReader(new FileInputStream(m_filePath))));
                  while (reader.readLine() != null) {
                      lines++;
                  }
                  reader.close();
                  // if 11.75 windows are available, we don't want to end on window nr. 10
                  int availWindows = (int)Math.ceil((double)lines / (double)m_windowSize);
                  // we start with window 0
                  m_windowPos = availWindows - 1;
              } catch (IOException ioex) {
                  LOG.error("Unable to scroll file " + m_filePath + " to end. Ensure that it exists. ");
              } finally {
                  if (reader != null) {
                      try {
                          reader.close();
                      } catch (Throwable f) {
                          LOG.info("Unable to close reader of file " + m_filePath, f);
                      }
                  }
              }
          }
          return lines;
      }
docs: Internally sets the member <code>m_windowPos</code> to the last available
  window of <code>m_windowSize</code> windows to let further calls to
  <code>{@link #readFilePortion()}</code> display the end of the file. <p>
  
  This method is triggered when a new file is chosen
  (<code>{@link #setFilePath(String)}</code>) because the amount of lines changes.
  This method is also triggered when a different window size is chosen
  (<code>{@link #setWindowSize(int)}</code>) because the amount of lines to display change.
  
  @return the amount of lines in the file to view