View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.rolling.helper;
15  
16  
17  public class CompressionRunnable implements Runnable {
18  
19    final Compressor compressor;
20    final String nameOfFile2Compress;
21    final String nameOfCompressedFile;
22    final String innerEntryName;
23  
24    public CompressionRunnable(Compressor compressor, String nameOfFile2Compress,
25                               String nameOfCompressedFile, String innerEntryName) {
26      this.compressor = compressor;
27      this.nameOfFile2Compress = nameOfFile2Compress;
28      this.nameOfCompressedFile = nameOfCompressedFile;
29      this.innerEntryName = innerEntryName;
30    }
31  
32    public void run() {
33      compressor.compress(nameOfFile2Compress, nameOfCompressedFile, innerEntryName);
34    }
35  }