You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jv...@apache.org on 2001/02/27 16:24:05 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/texen/util FileUtil.java

jvanzyl     01/02/27 07:24:04

  Modified:    src/java/org/apache/velocity/texen/util FileUtil.java
  Log:
  - adding some file utils that were present in the
    o.a.turbine.torque.util.GeneralUtil class, they are general
    purpose so i pushed them back into velocity. trying to cleanup
    texen/torque.
  
  Revision  Changes    Path
  1.6       +30 -3     jakarta-velocity/src/java/org/apache/velocity/texen/util/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/texen/util/FileUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FileUtil.java	2001/02/27 08:03:03	1.5
  +++ FileUtil.java	2001/02/27 15:24:02	1.6
  @@ -61,12 +61,16 @@
   /**
    * A general file utility for use in the context
    *
  - * @author <a href="mailto:leon@opticode.co.za>Leon Messerschmidt</a>
  + * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
  + * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    */
   public class FileUtil
   {
       /**
  -     * Creates the directory s (and any parent directories needed)
  +     * Creates the directory s (and any parent directories needed).
  +     *
  +     * @param String path/directory to create.
  +     * @param String report of path/directory creation.
        */
       static public String mkdir (String s)
       {
  @@ -81,7 +85,30 @@
           {
               return e.toString();
           }
  -
       }
   
  +    /**
  +     * A method to get a File object.
  +     *
  +     * @param String path to file object to create.
  +     * @return File created file object.
  +     */
  +    public static File file(String s)
  +    {
  +        File f = new File(s);
  +        return f;
  +    }
  +    
  +    /**
  +     * A method to get a File object.
  +     *
  +     * @param String base path
  +     * @param String file name
  +     * @return File created file object.
  +     */
  +    public static File file(String base, String s)
  +    {
  +        File f = new File(base, s);
  +        return f;
  +    }
   }