org.apache.storm.daemon.logviewer.utils

## Class LogFileDownloader

- java.lang.Object
- - org.apache.storm.daemon.logviewer.utils.LogFileDownloader

-     public class LogFileDownloader
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogFileDownloader(String logRoot, String daemonLogRoot, ResourceAuthorizer resourceAuthorizer, StormMetricsRegistry metricsRegistry)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `downloadFile(String host, String fileName, String user, boolean isDaemon)` Checks authorization for the log file and download.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LogFileDownloader

          public LogFileDownloader(String logRoot,
                                   String daemonLogRoot,
                                   ResourceAuthorizer resourceAuthorizer,
                                   StormMetricsRegistry metricsRegistry)

      Constructor.

      Parameters:
        `logRoot` - root worker log directory
        `daemonLogRoot` - root daemon log directory
        `resourceAuthorizer` - `ResourceAuthorizer`
        `metricsRegistry` - The logviewer metrics registry

  - ### Method Detail

    - #### downloadFile

          public javax.ws.rs.core.Response downloadFile(String host,
                                                        String fileName,
                                                        String user,
                                                        boolean isDaemon)
                                                 throws IOException

      Checks authorization for the log file and download.

      Parameters:
        `host` - host address
        `fileName` - file to download
        `user` - username
        `isDaemon` - true if the file is a daemon log, false if the file is an worker log
      Returns:
        a Response which lets browsers download that file.
      Throws:
        `IOException`

Copyright © 2021 The Apache Software Foundation. All rights reserved.