Here you can find the source of isGzipFilename(File file)
Parameter | Description |
---|---|
file | file to check |
public static boolean isGzipFilename(File file)
//package com.java2s; import java.io.File; import java.util.Locale; public class Main { /**/*from w w w . ja v a 2s . c om*/ * Name of the suffix used on compressed output files */ public static final String GZ_SUFFIX = ".gz"; /** * @param file file to check * @return true if has GZIP file extension */ public static boolean isGzipFilename(File file) { return isGzipFilename(file.getName()); } /** * @param file file to check * @return true if has GZIP file extension */ public static boolean isGzipFilename(String file) { return file.toLowerCase(Locale.getDefault()).endsWith(GZ_SUFFIX); } }