You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2004/10/26 01:27:42 UTC

cvs commit: jakarta-commons/io/src/java/org/apache/commons/io FilenameUtils.java

scolebourne    2004/10/25 16:27:41

  Modified:    io/src/java/org/apache/commons/io FilenameUtils.java
  Log:
  Remove deprecated method for first release
  
  Revision  Changes    Path
  1.14      +2 -28     jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.java
  
  Index: FilenameUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FilenameUtils.java	24 Oct 2004 18:34:23 -0000	1.13
  +++ FilenameUtils.java	25 Oct 2004 23:27:41 -0000	1.14
  @@ -56,6 +56,7 @@
    * @author Martin Cooper
    * @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
    * @version $Id$
  + * @since Commons IO 1.1
    */
   public class FilenameUtils {
   
  @@ -462,33 +463,6 @@
               path = path.replace(INTERNAL_SEPARATOR_CHAR, File.separatorChar);
           }
           return path;
  -    }
  -
  -    // DEPRECATED. Though no replacement exists.
  -
  -    /**
  -     * Returns the filename portion of a file specification string.
  -     * Matches the equally named unix command.
  -     * @param filename filename to inspect
  -     * @param suffix additional remaining portion of name that if matches will
  -     * be removed
  -     * @return The filename string without the suffix.
  -     * @deprecated This method will be deleted.
  -     */
  -    public static String basename(String filename, String suffix) {
  -        int i = filename.lastIndexOf(File.separator) + 1;
  -        int lastDot =
  -            ((suffix != null) && (suffix.length() > 0))
  -                ? filename.lastIndexOf(suffix)
  -                : -1;
  -
  -        if (lastDot >= 0) {
  -            return filename.substring(i, lastDot);
  -        } else if (i > 0) {
  -            return filename.substring(i);
  -        } else {
  -            return filename; // else returns all (no path and no extension)
  -        }
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-commons/io/src/java/org/apache/commons/io FilenameUtils.java

Posted by Stephen Colebourne <sc...@btopenworld.com>.
I reckoned removePath() was the same, as the comment referred to basepath.
Stephen

----- Original Message -----
From: "Martin Cooper" <mf...@gmail.com>
> I was looking at that method yesterday and wondering why it was
> deprecated. Anyone know?
>
> --
> Martin Cooper
>
>
> On 25 Oct 2004 23:27:42 -0000, scolebourne@apache.org
> <sc...@apache.org> wrote:
> > scolebourne    2004/10/25 16:27:41
> >
> >  Modified:    io/src/java/org/apache/commons/io FilenameUtils.java
> >  Log:
> >  Remove deprecated method for first release
> >
> >  Revision  Changes    Path
> >  1.14      +2 -28
jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.java
> >
> >  Index: FilenameUtils.java
> >  ===================================================================
> >  RCS file:
/home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.ja
va,v
> >  retrieving revision 1.13
> >  retrieving revision 1.14
> >  diff -u -r1.13 -r1.14
> >  --- FilenameUtils.java        24 Oct 2004 18:34:23 -0000      1.13
> >  +++ FilenameUtils.java        25 Oct 2004 23:27:41 -0000      1.14
> >  @@ -56,6 +56,7 @@
> >    * @author Martin Cooper
> >    * @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
> >    * @version $Id$
> >  + * @since Commons IO 1.1
> >    */
> >   public class FilenameUtils {
> >
> >  @@ -462,33 +463,6 @@
> >               path = path.replace(INTERNAL_SEPARATOR_CHAR,
File.separatorChar);
> >           }
> >           return path;
> >  -    }
> >  -
> >  -    // DEPRECATED. Though no replacement exists.
> >  -
> >  -    /**
> >  -     * Returns the filename portion of a file specification string.
> >  -     * Matches the equally named unix command.
> >  -     * @param filename filename to inspect
> >  -     * @param suffix additional remaining portion of name that if
matches will
> >  -     * be removed
> >  -     * @return The filename string without the suffix.
> >  -     * @deprecated This method will be deleted.
> >  -     */
> >  -    public static String basename(String filename, String suffix) {
> >  -        int i = filename.lastIndexOf(File.separator) + 1;
> >  -        int lastDot =
> >  -            ((suffix != null) && (suffix.length() > 0))
> >  -                ? filename.lastIndexOf(suffix)
> >  -                : -1;
> >  -
> >  -        if (lastDot >= 0) {
> >  -            return filename.substring(i, lastDot);
> >  -        } else if (i > 0) {
> >  -            return filename.substring(i);
> >  -        } else {
> >  -            return filename; // else returns all (no path and no
extension)
> >  -        }
> >       }
> >
> >   }
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-commons/io/src/java/org/apache/commons/io FilenameUtils.java

Posted by Martin Cooper <mf...@gmail.com>.
I was looking at that method yesterday and wondering why it was
deprecated. Anyone know?

--
Martin Cooper


On 25 Oct 2004 23:27:42 -0000, scolebourne@apache.org
<sc...@apache.org> wrote:
> scolebourne    2004/10/25 16:27:41
> 
>  Modified:    io/src/java/org/apache/commons/io FilenameUtils.java
>  Log:
>  Remove deprecated method for first release
> 
>  Revision  Changes    Path
>  1.14      +2 -28     jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.java
> 
>  Index: FilenameUtils.java
>  ===================================================================
>  RCS file: /home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/FilenameUtils.java,v
>  retrieving revision 1.13
>  retrieving revision 1.14
>  diff -u -r1.13 -r1.14
>  --- FilenameUtils.java        24 Oct 2004 18:34:23 -0000      1.13
>  +++ FilenameUtils.java        25 Oct 2004 23:27:41 -0000      1.14
>  @@ -56,6 +56,7 @@
>    * @author Martin Cooper
>    * @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
>    * @version $Id$
>  + * @since Commons IO 1.1
>    */
>   public class FilenameUtils {
> 
>  @@ -462,33 +463,6 @@
>               path = path.replace(INTERNAL_SEPARATOR_CHAR, File.separatorChar);
>           }
>           return path;
>  -    }
>  -
>  -    // DEPRECATED. Though no replacement exists.
>  -
>  -    /**
>  -     * Returns the filename portion of a file specification string.
>  -     * Matches the equally named unix command.
>  -     * @param filename filename to inspect
>  -     * @param suffix additional remaining portion of name that if matches will
>  -     * be removed
>  -     * @return The filename string without the suffix.
>  -     * @deprecated This method will be deleted.
>  -     */
>  -    public static String basename(String filename, String suffix) {
>  -        int i = filename.lastIndexOf(File.separator) + 1;
>  -        int lastDot =
>  -            ((suffix != null) && (suffix.length() > 0))
>  -                ? filename.lastIndexOf(suffix)
>  -                : -1;
>  -
>  -        if (lastDot >= 0) {
>  -            return filename.substring(i, lastDot);
>  -        } else if (i > 0) {
>  -            return filename.substring(i);
>  -        } else {
>  -            return filename; // else returns all (no path and no extension)
>  -        }
>       }
> 
>   }
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org