This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 10418 - Bug in ModuleUpdater.java ver 1.15
Summary: Bug in ModuleUpdater.java ver 1.15
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: akemr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-16 18:10 UTC by Jun Luo
Modified: 2002-07-19 15:16 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jun Luo 2001-03-16 18:10:48 UTC
I have enclosed a proposed patch for the following issues:

1. Corrected comment for UPDATE_MAIN_DIR member;
2. Corrected the assignment for mainargs in MainConfig class;
3. Adding the size files under main/ to totallength and also update progress
bar when these files are extracted.    I believe this patch is needed to
keep the length and progress accurate.   This is especially important when
external installer contains large files.

I have began relying on this new feature, and have tested the patches in my
project and they work as expected now.

Please let me know if this patch is acceptable.
I just want to say once again that this external installer new feature is
COOOL!

Thanks,
Jun

Index: ModuleUpdater.java
===================================================================
RCS file: /cvs/autoupdate/libsrc/org/netbeans/updater/ModuleUpdater.java,v
retrieving revision 1.15
diff -c -r1.15 ModuleUpdater.java
*** ModuleUpdater.java	2001/03/09 10:36:35	1.15
--- ModuleUpdater.java	2001/03/15 21:59:56
***************
*** 58,64 ****
      /** The name of zip entry containing java_extension files */
      public static final String UPDATE_JAVA_EXT_DIR = "java_ext"; // NOI18N
  
!     /** The name of zip entry containing java_extension files */
      public static final String UPDATE_MAIN_DIR = "main"; // NOI18N
      
      /** Absolut name of directory where are external installers*/
--- 58,64 ----
      /** The name of zip entry containing java_extension files */
      public static final String UPDATE_JAVA_EXT_DIR = "java_ext"; // NOI18N
  
!     /** The name of zip entry containing files for external installer */
      public static final String UPDATE_MAIN_DIR = "main"; // NOI18N
      
      /** Absolut name of directory where are external installers*/
***************
*** 176,183 ****
                      checkStop();
  
                      if ( ( entry.getName().startsWith( UPDATE_NETBEANS_DIR ) 
||
!                             entry.getName().startsWith( 
ModuleUpdater.UPDATE_JAVA_EXT_DIR ) ) &&
!                             !entry.isDirectory() ) {
                          totalLength += entry.getSize();
                      }
                  }
--- 176,184 ----
                      checkStop();
  
                      if ( ( entry.getName().startsWith( UPDATE_NETBEANS_DIR ) 
||
!                            entry.getName().startsWith( 
ModuleUpdater.UPDATE_JAVA_EXT_DIR ) ||
!                            entry.getName().startsWith( UPDATE_MAIN_DIR) ) &&
!                          !entry.isDirectory() ) {
                          totalLength += entry.getSize();
                      }
                  }
***************
*** 280,285 ****
--- 281,288 ----
                          destFile.getParentFile ().mkdirs ();
                          hasMainClass = true;
                          copyStreams( jarFile.getInputStream( entry ), new 
FileOutputStream( destFile ) );                        
+                         bytesRead += entry.getSize();
+                         UpdaterFrame.setProgressValue( bytesRead );
                      }
                  }
                  if ( hasMainClass ) {                    
***************
*** 585,591 ****
              else
                  parameters = parameters + " " + mainclass;
              
!             mainargs = details.getProperty(PAR_JVMPAR,null);
              if (mainargs != null)
                  parameters = parameters + " " + mainargs;
  
--- 588,594 ----
              else
                  parameters = parameters + " " + mainclass;
              
!             mainargs = details.getProperty(PAR_MAINARGS,null);
              if (mainargs != null)
                  parameters = parameters + " " + mainargs;
Comment 1 akemr 2001-03-19 09:21:41 UTC
Thanks for proposed patch! It's correct and I fixed it in dev and 3.2 builds. 
Fix will be in next build.

Ales
Comment 2 akemr 2001-03-23 09:34:41 UTC
Fixed