harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r985566 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ drlvm/ jdktools/ jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
Date Sat, 14 Aug 2010 19:12:29 GMT
Author: hindessm
Date: Sat Aug 14 19:12:28 2010
New Revision: 985566

URL: http://svn.apache.org/viewvc?rev=985566&view=rev
Log:
Merge change from /harmony/enhanced/java/trunk@985098:

  r985098 | regisxu | 2010-08-13 06:31:03 +0100 (Fri, 13 Aug 2010) | 1 line
  
  Apply patch for HARMONY-6622: [jdktools][jar]jar command throws FileNotFoundException when
creating jar file with absolute file path


Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 14 19:12:28 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798
+/harmony/enhanced/java/trunk:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 14 19:12:28 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798
+/harmony/enhanced/java/trunk/classlib:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 14 19:12:28 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 14 19:12:28 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798
+/harmony/enhanced/java/trunk/drlvm:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Aug 14 19:12:28 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798
+/harmony/enhanced/java/trunk/jdktools:929253-979569,979593,979613,979615,979647,979659,979682,979897,980326,980632,981356,981763,981811,981820,982146,982148,982183,982250,982377,982498,982614,982650,982777,982887,983879,983902,984367,984577,984597-984598,984613,984682,984708,984731,984779,984784,984798,985098
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java?rev=985566&r1=985565&r2=985566&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/jar/Main.java
Sat Aug 14 19:12:28 2010
@@ -128,7 +128,6 @@ public class Main {
             zos = new ZipOutputStream(new FileOutputStream(new File(args[1])));
         }
 
-        String workingDir = System.getProperty("user.dir");
         int firstFileIndex = 0;
         if (manifestFlag) {
             firstFileIndex = 3;
@@ -139,11 +138,11 @@ public class Main {
         // Assume that all the args following the manifest (if provided) are the name of
files to add to the archive
         for (int i=firstFileIndex; i < args.length; i++) {
             // attempt to add the file to the output stream
-            File f = new File(workingDir + File.separator + args[i]);
+            File f = new File(args[i]);
             if (f.isDirectory()) {
-                processDir(f, zos, workingDir, verboseFlag);
+                processDir(f, zos, verboseFlag);
             } else {
-                processFile(f, zos, workingDir, verboseFlag);
+                processFile(f, zos, verboseFlag);
             }
         }
         
@@ -197,7 +196,6 @@ public class Main {
 
         // Read the zip entries - format and print their data
         ZipEntry ze;
-        String workingDir = System.getProperty("user.dir");
         
         while ((ze = zis.getNextEntry()) != null) {
             if (ze.isDirectory()) {
@@ -211,7 +209,7 @@ public class Main {
                 }
             } else {
                 // extract the file to the appropriate directory
-                File f = new File(workingDir + File.separator + ze.getName());
+                File f = new File(ze.getName());
                 f.createNewFile();
                 FileOutputStream fos = new FileOutputStream(f);
                 int i;
@@ -288,12 +286,12 @@ public class Main {
         System.out.println("Error: Jar indexing not yet implemented");
     }
     
-    private static void processDir(File dir, ZipOutputStream zos, String workingDir, boolean
verboseFlag) throws IOException {	
+    private static void processDir(File dir, ZipOutputStream zos, boolean verboseFlag) throws
IOException {
         // First add the dir to the ZipOutputStream
-        String relativePath = dir.getAbsolutePath().substring(workingDir.length() + 1);	

-        ZipEntry zEntry = new ZipEntry(relativePath);
+        String path = dir.getPath().replace('\\', '/') + "/";
+        ZipEntry zEntry = new ZipEntry(path);
         if (verboseFlag) {
-            System.out.println("adding: " + relativePath);
+            System.out.println("adding: " + path);
         }
         zos.putNextEntry(zEntry);
 
@@ -302,22 +300,22 @@ public class Main {
         for (int i=0; i < filesInDir.length; i++) {
             File curFile = filesInDir[i];
             if (curFile.isDirectory()) {
-                processDir(curFile, zos, workingDir, verboseFlag);
+                processDir(curFile, zos, verboseFlag);
             } else {
-                processFile(curFile, zos, workingDir, verboseFlag);
+                processFile(curFile, zos, verboseFlag);
             }
         }
 
         zos.closeEntry();
     }
 
-    private static void processFile(File file, ZipOutputStream zos, String workingDir, boolean
verboseFlag) throws IOException {
-        String relativePath = file.getAbsolutePath().substring(workingDir.length() + 1);
+    private static void processFile(File file, ZipOutputStream zos, boolean verboseFlag)
throws IOException {
+        String path = file.getPath().replace('\\', '/');
         if (verboseFlag) {
-            System.out.println("adding: " + relativePath);
+            System.out.println("adding: " + path);
         }
 
-        ZipEntry zEntry = new ZipEntry(relativePath);
+        ZipEntry zEntry = new ZipEntry(path);
         zos.putNextEntry(zEntry);
         // now write the data
         FileInputStream fis = new FileInputStream(file);



Mime
View raw message