Package hudson.util
Class CompressedFile
- java.lang.Object
-
- hudson.util.CompressedFile
-
public class CompressedFile extends Object
Represents write-once read-many file that can be optionally compressed to save disk space. This is used for console output and other bulky data.In this class, the data on the disk can be one of two states:
- Uncompressed, in which case the original data is available in the specified file name.
- Compressed, in which case the gzip-compressed data is available in the specified file name + ".gz" extension.
compress()
.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description CompressedFile(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
compress()
Asynchronously schedules the compression of this file.String
loadAsString()
Deprecated.removed without replacementInputStream
read()
Reads the contents of a file.OutputStream
write()
Gets the OutputStream to write to the file.
-
-
-
Constructor Detail
-
CompressedFile
public CompressedFile(File file)
-
-
Method Detail
-
write
public OutputStream write() throws IOException
Gets the OutputStream to write to the file.- Throws:
IOException
-
read
public InputStream read() throws IOException
Reads the contents of a file.- Throws:
IOException
-
loadAsString
@Deprecated public String loadAsString() throws IOException
Deprecated.removed without replacementLoads the file content as a string.- Throws:
IOException
-
compress
public void compress()
Asynchronously schedules the compression of this file.Once the file is compressed, the original will be removed and the further reading will be done from the compressed stream.
-
-