Changeset 2756


Ignore:
Timestamp:
03/27/13 15:32:08 (11 years ago)
Author:
twagoo
Message:

Close log file after reading tail
[Refs #294]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/frontend/ViewLogPage.java

    r2755 r2756  
    4747            try {
    4848                final RandomAccessFile raLogFile = geFileTail(logFile, tailSize);
    49                 final String content = getLogFileContent(raLogFile);
     49                try {
     50                    final String content = getLogFileContent(raLogFile);
    5051
    51                 add(new Label("logLabel", String.format("Showing final %s bytes (or less) of total %s in %s:", numberFormat.format(tailSize), numberFormat.format(raLogFile.length()), logFile)));
    52                 add(new TextArea("logText", new Model(content)));
     52                    add(new Label("logLabel", String.format("Showing final %s bytes (or less) of total %s in %s:", numberFormat.format(tailSize), numberFormat.format(raLogFile.length()), logFile)));
     53                    add(new TextArea("logText", new Model(content)));
    5354
    54                 add(new DownloadLink("logDownloadLink", logFile));
     55                    add(new DownloadLink("logDownloadLink", logFile));
     56                } finally {
     57                    raLogFile.close();
     58                }
    5559            } catch (IOException ioEx) {
    5660                add(new Label("logLabel", "Could not read from log file. See error message below."));
Note: See TracChangeset for help on using the changeset viewer.