avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mirceat...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/installer Installer.java
Date Wed, 31 Oct 2001 21:58:47 GMT
mirceatoma    01/10/31 13:58:47

  Modified:    src/java/org/apache/avalon/phoenix/tools/installer
                        Installer.java
  Log:
  Modify code to account for FileDigest and Installation changes.
  
  Revision  Changes    Path
  1.15      +12 -9     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/installer/Installer.java
  
  Index: Installer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/installer/Installer.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Installer.java	2001/10/28 09:49:42	1.14
  +++ Installer.java	2001/10/31 21:58:47	1.15
  @@ -75,21 +75,21 @@
                   
           if( infos != null )
           {
  +            final String message = REZ.getString( "skip-removal", file );
  +            
               for( int i = 0; i < infos.length; i++ )
               {
                   final File file = infos[i].getFile();
                   final File parent = file.getParentFile();
  -                
  +                                
                   if( file.exists() )
                   {                    
  -                    final String message = REZ.getString( "skip-removal", file );
  -                    
  -                    if( file.lastModified() != infos[i].getModified() )
  +                    if( file.lastModified() <= installation.getTimestamp() )
                       {
                           getLogger().debug( message );                        
                           continue;
                       }
  -
  +                    
                       checksum( file, checksum );
   
                       if( checksum.getValue() != infos[i].getChecksum() )
  @@ -338,8 +338,9 @@
           final String config = getURLAsString( new File( directory, FS_CONFIG_XML ) );
           final String server = getURLAsString( new File( directory, FS_SERVER_XML ) );
           final FileDigest[] fileDigests = (FileDigest[])digests.toArray( new FileDigest[0]
);
  +        final long timestamp = System.currentTimeMillis();
   
  -        return new Installation( file, directory, config, assembly, server, classPath,
fileDigests );
  +        return new Installation( file, directory, config, assembly, server, classPath,
fileDigests, timestamp );
       }
   
       /**
  @@ -399,8 +400,9 @@
           final String assembly = getURLAsString( new File( directory, OLD_ASSEMBLY_XML )
);
           final String server = getURLAsString( new File( directory, OLD_SERVER_XML ) );
           final FileDigest[] fileDigests = (FileDigest[])digests.toArray( new FileDigest[0]
);
  +        final long timestamp = System.currentTimeMillis();
   
  -        return new Installation( file, directory, config, assembly, server, classPath,
fileDigests );
  +        return new Installation( file, directory, config, assembly, server, classPath,
fileDigests, timestamp );
       }
   
       /**
  @@ -416,8 +418,9 @@
           final String config = getURLAsString( new File( directory, OLD_CONFIG_XML ) );
           final String assembly = getURLAsString( new File( directory, OLD_ASSEMBLY_XML )
);
           final String server = getURLAsString( new File( directory, OLD_SERVER_XML ) );
  +        final long timestamp = System.currentTimeMillis();
   
  -        return new Installation( directory, directory, config, assembly, server, classPath,
null );
  +        return new Installation( directory, directory, config, assembly, server, classPath,
null, timestamp );
       }
      
       /**
  @@ -492,7 +495,7 @@
           
           final long checksum = entry.getCrc();
           final long modified = file.lastModified();
  -        final FileDigest info = new FileDigest( file, checksum, modified );
  +        final FileDigest info = new FileDigest( file, checksum );
   
           digests.add( info );
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message