fix zip copy

Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d82f28a7
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d82f28a7
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d82f28a7

Branch: refs/heads/feature-autobuild/example-maven-dirs
Commit: d82f28a771b48984af1402ebec79001eb91d6ded
Parents: e961730
Author: Alex Harui <[email protected]>
Authored: Wed Nov 9 11:41:45 2016 -0800
Committer: Alex Harui <[email protected]>
Committed: Wed Nov 9 11:44:01 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/flex/compiler/clients/COMPJSC.java  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d82f28a7/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java 
b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
index bd9a3b1..ac89544 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
@@ -227,9 +227,11 @@ public class COMPJSC extends MXMLJSC
                         if (!entry.getName().contains("js/out") &&
                                
!entry.getName().contains(SWCReader.CATALOG_XML))
                         {
+                            System.out.println("Copy " + entry.getName());
                                InputStream input = 
zipFile.getInputStream(entry);
-                               zipOutputStream.putNextEntry(entry);
+                               zipOutputStream.putNextEntry(new 
ZipEntry(entry.getName()));
                                IOUtils.copy(input, zipOutputStream);
+                            zipOutputStream.flush();
                                zipOutputStream.closeEntry();
                         }
                     }
@@ -329,7 +331,8 @@ public class COMPJSC extends MXMLJSC
                                problems.addAll(errors);
                                zipOutputStream.putNextEntry(new 
ZipEntry(outputClassFile));
                                writer.writeTo(zipOutputStream);
-                               zipOutputStream.closeEntry();                   
+                            zipOutputStream.flush();
+                               zipOutputStream.closeEntry();
                                writer.close();
                                fileList.append("        <file path=\"" + 
outputClassFile + "\" mod=\"" + System.currentTimeMillis() + "\"/>\n");
                        }
@@ -344,7 +347,9 @@ public class COMPJSC extends MXMLJSC
                                catalog.substring(libraryIndex + 13);
                     zipOutputStream.putNextEntry(new 
ZipEntry(SWCReader.CATALOG_XML));
                        zipOutputStream.write(catalog.getBytes());
-                    zipOutputStream.closeEntry();                   
+                    zipOutputStream.flush();
+                    zipOutputStream.closeEntry();
+                    zipOutputStream.flush();
                        zipOutputStream.close();
                        swcFile.delete();
                        File newSWCFile = new File(outputFolderName + ".new");
@@ -355,6 +360,7 @@ public class COMPJSC extends MXMLJSC
         }
         catch (Exception e)
         {
+            System.out.println(e);
             final ICompilerProblem problem = new InternalCompilerProblem(e);
             problems.add(problem);
         }

Reply via email to