Modify the jar construction code to be standard
Project: http://git-wip-us.apache.org/repos/asf/incubator-crunch/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-crunch/commit/ab0a99dc Tree: http://git-wip-us.apache.org/repos/asf/incubator-crunch/tree/ab0a99dc Diff: http://git-wip-us.apache.org/repos/asf/incubator-crunch/diff/ab0a99dc Branch: refs/heads/master Commit: ab0a99dc190e12c789ca32148dd03ef315427d38 Parents: 1ed5790 Author: jwills <[email protected]> Authored: Mon Jul 9 23:57:42 2012 -0700 Committer: jwills <[email protected]> Committed: Mon Jul 9 23:57:42 2012 -0700 ---------------------------------------------------------------------- .../scrunch/interpreter/InterpreterRunner.scala | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-crunch/blob/ab0a99dc/scrunch/src/main/scala/org/apache/scrunch/interpreter/InterpreterRunner.scala ---------------------------------------------------------------------- diff --git a/scrunch/src/main/scala/org/apache/scrunch/interpreter/InterpreterRunner.scala b/scrunch/src/main/scala/org/apache/scrunch/interpreter/InterpreterRunner.scala index 3da73d6..e37a0c7 100644 --- a/scrunch/src/main/scala/org/apache/scrunch/interpreter/InterpreterRunner.scala +++ b/scrunch/src/main/scala/org/apache/scrunch/interpreter/InterpreterRunner.scala @@ -170,13 +170,18 @@ object InterpreterRunner extends MainGenericRunner { dir.foreach { file => if (file.isDirectory) { // Recursively descend into subdirectories, adjusting the package name as we do. + val dirPath = entryPath + file.name + "/" + val entry: JarEntry = new JarEntry(dirPath) + jarStream.putNextEntry(entry) + jarStream.closeEntry() addVirtualDirectoryToJar(file.asInstanceOf[VirtualDirectory], - entryPath + file.name + "/", jarStream) + dirPath, jarStream) } else if (file.hasExtension("class")) { // Add class files as an entry in the jar file and write the class to the jar. val entry: JarEntry = new JarEntry(entryPath + file.name) jarStream.putNextEntry(entry) jarStream.write(file.toByteArray) + jarStream.closeEntry() } } }
