ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types ScannerUtil.java
Date Sun, 27 Jan 2002 09:57:41 GMT
donaldp     02/01/27 01:57:41

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        TarFileSet.java Tar.java
               proposal/myrmidon/src/main/org/apache/tools/ant/types
                        ScannerUtil.java
  Log:
  Move TarFileSet.getFiles() into ScannerUtil
  
  Revision  Changes    Path
  1.3       +0 -28     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/TarFileSet.java
  
  Index: TarFileSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/TarFileSet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TarFileSet.java	26 Jan 2002 02:08:10 -0000	1.2
  +++ TarFileSet.java	27 Jan 2002 09:57:40 -0000	1.3
  @@ -8,16 +8,11 @@
   package org.apache.tools.ant.taskdefs;
   
   import org.apache.tools.ant.types.FileSet;
  -import org.apache.tools.ant.types.DirectoryScanner;
  -import org.apache.tools.ant.types.ScannerUtil;
  -import org.apache.myrmidon.api.TaskException;
   
   public class TarFileSet
       extends FileSet
   {
  -    private String[] m_files;
       private int m_mode = 0100644;
  -
       private String m_userName = "";
       private String m_groupName = "";
   
  @@ -34,29 +29,6 @@
       public void setUserName( final String userName )
       {
           m_userName = userName;
  -    }
  -
  -    /**
  -     * Get a list of files and directories specified in the fileset.
  -     *
  -     * @return a list of file and directory names, relative to the baseDir
  -     *      for the project.
  -     */
  -    protected String[] getFiles()
  -        throws TaskException
  -    {
  -        if( m_files == null )
  -        {
  -            final DirectoryScanner scanner = ScannerUtil.getDirectoryScanner( this );
  -            final String[] directories = scanner.getIncludedDirectories();
  -            final String[] filesPerSe = scanner.getIncludedFiles();
  -            m_files = new String[ directories.length + filesPerSe.length ];
  -            System.arraycopy( directories, 0, m_files, 0, directories.length );
  -            System.arraycopy( filesPerSe, 0, m_files, directories.length,
  -                              filesPerSe.length );
  -        }
  -
  -        return m_files;
       }
   
       protected String getGroup()
  
  
  
  1.22      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java
  
  Index: Tar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Tar.java	27 Jan 2002 01:20:34 -0000	1.21
  +++ Tar.java	27 Jan 2002 09:57:40 -0000	1.22
  @@ -18,6 +18,7 @@
   import org.apache.avalon.excalibur.io.IOUtil;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.types.SourceFileScanner;
  +import org.apache.tools.ant.types.ScannerUtil;
   import org.apache.tools.ant.util.mappers.MergingMapper;
   
   /**
  @@ -140,7 +141,7 @@
           for( Iterator e = filesets.iterator(); e.hasNext(); )
           {
               TarFileSet fs = (TarFileSet)e.next();
  -            String[] files = fs.getFiles();
  +            String[] files = ScannerUtil.getFiles( fs );
   
               if( !archiveIsUpToDate( files ) )
               {
  @@ -188,7 +189,7 @@
               for( Iterator e = filesets.iterator(); e.hasNext(); )
               {
                   TarFileSet fs = (TarFileSet)e.next();
  -                String[] files = fs.getFiles();
  +                String[] files = ScannerUtil.getFiles( fs );
                   for( int i = 0; i < files.length; i++ )
                   {
                       File f = new File( fs.getDir(), files[ i ] );
  
  
  
  1.5       +21 -1     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ScannerUtil.java
  
  Index: ScannerUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/types/ScannerUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ScannerUtil.java	27 Jan 2002 09:42:07 -0000	1.4
  +++ ScannerUtil.java	27 Jan 2002 09:57:41 -0000	1.5
  @@ -14,6 +14,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.PatternUtil;
   import org.apache.myrmidon.framework.PatternSet;
  +import org.apache.tools.ant.taskdefs.TarFileSet;
   
   /**
    *
  @@ -21,7 +22,7 @@
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author Arnout J. Kuiper <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
    * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
  - * @version $Revision: 1.4 $ $Date: 2002/01/27 09:42:07 $
  + * @version $Revision: 1.5 $ $Date: 2002/01/27 09:57:41 $
    */
   public class ScannerUtil
   {
  @@ -606,5 +607,24 @@
           {
               return getDirectoryScanner( set );
           }
  +    }
  +
  +    /**
  +     * Get a list of files and directories specified in the fileset.
  +     *
  +     * @return a list of file and directory names, relative to the baseDir
  +     *      for the project.
  +     */
  +    public static String[] getFiles( final TarFileSet set )
  +        throws TaskException
  +    {
  +        final DirectoryScanner scanner = getDirectoryScanner( set );
  +        final String[] directories = scanner.getIncludedDirectories();
  +        final String[] filesPerSe = scanner.getIncludedFiles();
  +        final String[] files = new String[ directories.length + filesPerSe.length ];
  +        System.arraycopy( directories, 0, files, 0, directories.length );
  +        System.arraycopy( filesPerSe, 0, files, directories.length,
  +                          filesPerSe.length );
  +        return files;
       }
   }
  
  
  

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


Mime
View raw message