Re: MiscUtils.getFileNameWithoutExtension

From: Mike Schrag (mschra..dimension.com)
Date: Sun Mar 30 2008 - 17:07:57 EDT

  • Next message: Lachlan Deck: "Re: MiscUtils.getFileNameWithoutExtension"

    bug

    On Mar 30, 2008, at 1:33 AM, Lachlan Deck wrote:

    > Just perusing things, and noticed this...
    >
    > Any reason why this method returns the file using the first index of
    > '.' rather than the last? Or why does it not just use
    > _resource.getFileExtension?
    >
    > package org.objectstyle.wolips.eomodeler.core.utils;
    >
    > import org.eclipse.core.resources.IResource;
    >
    > public class MiscUtils {
    > public static String getFileNameWithoutExtension(IResource
    > _resource) {
    > String fileName = _resource.getName();
    > String fileExtension = _resource.getFileExtension();
    > if (fileExtension != null) {
    > fileName = fileName.substring(0, fileName.indexOf('.'));
    > }
    > return fileName;
    > }
    > }
    >
    > with regards,
    > --
    >
    > Lachlan Deck
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Mar 30 2008 - 17:09:04 EDT