Java String Ends With endsWithExtension(final String fileName, final String extension)

Here you can find the source of endsWithExtension(final String fileName, final String extension)

Description

ends With Extension

License

Open Source License

Declaration

private static boolean endsWithExtension(final String fileName, final String extension) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright 2009 Regents of the University of Minnesota. All rights
 * reserved.// w  ww  .  j  ava2 s  . co  m
 * Copyright 2009 Mayo Foundation for Medical Education and Research.
 * All rights reserved.
 *
 * This program is made available under the terms of the Eclipse
 * Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS
 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
 * PARTICULAR PURPOSE.  See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * Contributors:
 * Minnesota Supercomputing Institute - initial API and implementation
 ******************************************************************************/

public class Main {
    private static boolean endsWithExtension(final String fileName, final String extension) {
        return fileName != null && fileName.toLowerCase().endsWith(extension.toLowerCase());
    }
}

Related

  1. endsWithChar(String string, int character)
  2. endsWithContinuationMarker(String line)
  3. endsWithCVC(String str)
  4. endsWithDigit(final String s)
  5. endsWithDoubleConsonent(String str)
  6. endsWithFFD9(byte[] data)
  7. endsWithGaps(final byte[] aFrag, final int numEndGaps)
  8. endsWithIC(String a, String b)
  9. endsWithIC(String s1, String s2)