Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/5792#discussion_r31167919
--- Diff:
core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala ---
@@ -212,6 +263,25 @@ class HistoryServerSuite extends FunSuite with
BeforeAndAfter with Matchers with
out.write(json)
out.close()
}
+
+ def unzipToDir(inputStream: InputStream, dir: File): Unit = {
+ val unzipStream = new ZipInputStream(inputStream)
+ val buffer = new Array[Byte](64 * 1024 * 1024)
+ var nextEntry = unzipStream.getNextEntry
+ while(nextEntry != null) {
+ val file = new File(dir, nextEntry.getName)
+ val outputStream = new BufferedOutputStream(new
FileOutputStream(file))
+ var dataRemains = true
+ while (dataRemains) {
--- End diff --
Guava has `ByteStreams.copy()` which can be useful here (and probably in
other places in this change?).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]