ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Copy.java
Date Fri, 28 Mar 2003 08:06:54 GMT
bodewig     2003/03/28 00:06:54

  Modified:    src/main/org/apache/tools/ant/taskdefs Copy.java
  Log:
  revert some formatting changes
  
  Revision  Changes    Path
  1.55      +48 -48    ant/src/main/org/apache/tools/ant/taskdefs/Copy.java
  
  Index: Copy.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- Copy.java	28 Mar 2003 07:51:11 -0000	1.54
  +++ Copy.java	28 Mar 2003 08:06:53 -0000	1.55
  @@ -417,66 +417,66 @@
           }
       }
   
  -    //************************************************************************
  -        //  protected and private methods
  -        //************************************************************************
  -
  -        /**
  -         * Ensure we have a consistent and legal set of attributes, and set
  -         * any internal flags necessary based on different combinations
  -         * of attributes.
  -         */
  -        protected void validateAttributes() throws BuildException {
  -            if (file == null && filesets.size() == 0) {
  -                throw new BuildException("Specify at least one source "
  -                                         + "- a file or a fileset.");
  -            }
  +//************************************************************************
  +//  protected and private methods
  +//************************************************************************
  +
  +    /**
  +     * Ensure we have a consistent and legal set of attributes, and set
  +     * any internal flags necessary based on different combinations
  +     * of attributes.
  +     */
  +    protected void validateAttributes() throws BuildException {
  +        if (file == null && filesets.size() == 0) {
  +            throw new BuildException("Specify at least one source "
  +                                     + "- a file or a fileset.");
  +        }
   
  -            if (destFile != null && destDir != null) {
  -                throw new BuildException("Only one of tofile and todir "
  -                                         + "may be set.");
  -            }
  +        if (destFile != null && destDir != null) {
  +            throw new BuildException("Only one of tofile and todir "
  +                                     + "may be set.");
  +        }
   
  -            if (destFile == null && destDir == null) {
  -                throw new BuildException("One of tofile or todir must be set.");
  -            }
  +        if (destFile == null && destDir == null) {
  +            throw new BuildException("One of tofile or todir must be set.");
  +        }
   
  -            if (file != null && file.exists() && file.isDirectory()) {
  -                throw new BuildException("Use a fileset to copy directories.");
  -            }
  +        if (file != null && file.exists() && file.isDirectory()) {
  +            throw new BuildException("Use a fileset to copy directories.");
  +        }
   
  -            if (destFile != null && filesets.size() > 0) {
  -                if (filesets.size() > 1) {
  +        if (destFile != null && filesets.size() > 0) {
  +            if (filesets.size() > 1) {
  +                throw new BuildException(
  +                    "Cannot concatenate multiple files into a single file.");
  +            } else {
  +                FileSet fs = (FileSet) filesets.elementAt(0);
  +                DirectoryScanner ds = fs.getDirectoryScanner(getProject());
  +                String[] srcFiles = ds.getIncludedFiles();
  +
  +                if (srcFiles.length == 0) {
                       throw new BuildException(
  -                                             "Cannot concatenate multiple files into a
single file.");
  -                } else {
  -                    FileSet fs = (FileSet) filesets.elementAt(0);
  -                    DirectoryScanner ds = fs.getDirectoryScanner(getProject());
  -                    String[] srcFiles = ds.getIncludedFiles();
  -
  -                    if (srcFiles.length == 0) {
  -                        throw new BuildException(
  -                                                 "Cannot perform operation from directory
to file.");
  -                    } else if (srcFiles.length == 1) {
  -                        if (file == null) {
  -                            file = new File(ds.getBasedir(), srcFiles[0]);
  -                            filesets.removeElementAt(0);
  -                        } else {
  -                            throw new BuildException("Cannot concatenate multiple "
  -                                                     + "files into a single file.");
  -                        }
  +                        "Cannot perform operation from directory to file.");
  +                } else if (srcFiles.length == 1) {
  +                    if (file == null) {
  +                        file = new File(ds.getBasedir(), srcFiles[0]);
  +                        filesets.removeElementAt(0);
                       } else {
                           throw new BuildException("Cannot concatenate multiple "
                                                    + "files into a single file.");
                       }
  +                } else {
  +                    throw new BuildException("Cannot concatenate multiple "
  +                                             + "files into a single file.");
                   }
               }
  +        }
   
  -            if (destFile != null) {
  -                destDir = fileUtils.getParentFile(destFile);
  -            }
  -
  +        if (destFile != null) {
  +            destDir = fileUtils.getParentFile(destFile);
           }
  +
  +    }
   
       /**
        * Compares source files to destination files to see if they should be
  
  
  

Mime
View raw message