@Test public void testGetFileExtension() { Assert.assertEquals(".vcf", NgbFileUtils.getFileExtension("vcf_file.vcf")); Assert.assertEquals(".vcf.gz", NgbFileUtils.getFileExtension("vcf_file.vcf.gz")); Assert.assertEquals(".vcf.gz.tbi", NgbFileUtils.getFileExtension("vcf_file.vcf.gz.tbi")); Assert.assertEquals(".vcf.idx", NgbFileUtils.getFileExtension("vcf_file.vcf.idx")); Assert.assertEquals(".tbi", NgbFileUtils.getFileExtension("index.tbi")); Assert.assertEquals(".tbi", NgbFileUtils.getFileExtension("index.foo.tbi")); }
public static String getFileExtension(String fileName) { if (fileName.endsWith(GZ_EXTENSION) || fileName.endsWith(TBI_EXTENSION) || fileName.endsWith(IDX_EXTENSION)) { String extension = FilenameUtils.getExtension(fileName); return getFileExtension(fileName.substring(0, fileName.length() - extension.length() - 1)) + "." + extension; } String extension = FilenameUtils.getExtension(fileName); return extension.length() > 0 && FORMAT_MAP.containsKey("." + extension) ? "." + extension : ""; }
NgbFileUtils { public static String getFileExtension(String fileName) { if (fileName.endsWith(GZ_EXTENSION) || fileName.endsWith(TBI_EXTENSION) || fileName.endsWith(IDX_EXTENSION)) { String extension = FilenameUtils.getExtension(fileName); return getFileExtension(fileName.substring(0, fileName.length() - extension.length() - 1)) + "." + extension; } String extension = FilenameUtils.getExtension(fileName); return extension.length() > 0 && FORMAT_MAP.containsKey("." + extension) ? "." + extension : ""; } }
NgbFileUtils { public static String getFileExtension(String fileName) { if (fileName.endsWith(GZ_EXTENSION) || fileName.endsWith(TBI_EXTENSION) || fileName.endsWith(IDX_EXTENSION)) { String extension = FilenameUtils.getExtension(fileName); return getFileExtension(fileName.substring(0, fileName.length() - extension.length() - 1)) + "." + extension; } String extension = FilenameUtils.getExtension(fileName); return extension.length() > 0 && FORMAT_MAP.containsKey("." + extension) ? "." + extension : ""; } private  NgbFileUtils(); }
NgbFileUtils { public static String getFileExtension(String fileName) { if (fileName.endsWith(GZ_EXTENSION) || fileName.endsWith(TBI_EXTENSION) || fileName.endsWith(IDX_EXTENSION)) { String extension = FilenameUtils.getExtension(fileName); return getFileExtension(fileName.substring(0, fileName.length() - extension.length() - 1)) + "." + extension; } String extension = FilenameUtils.getExtension(fileName); return extension.length() > 0 && FORMAT_MAP.containsKey("." + extension) ? "." + extension : ""; } private  NgbFileUtils(); static String[] getSupportedExtensions(); static boolean isFileSupported(String fileName); static BiologicalDataItemFormat getFormatByExtension(String fileName); static String getFileExtension(String fileName); static boolean isFileBrowsingAllowed(BiologicalDataItemFormat format); static boolean isGzCompressed(String fileName); static boolean isRemotePath(String path); }
NgbFileUtils { public static String getFileExtension(String fileName) { if (fileName.endsWith(GZ_EXTENSION) || fileName.endsWith(TBI_EXTENSION) || fileName.endsWith(IDX_EXTENSION)) { String extension = FilenameUtils.getExtension(fileName); return getFileExtension(fileName.substring(0, fileName.length() - extension.length() - 1)) + "." + extension; } String extension = FilenameUtils.getExtension(fileName); return extension.length() > 0 && FORMAT_MAP.containsKey("." + extension) ? "." + extension : ""; } private  NgbFileUtils(); static String[] getSupportedExtensions(); static boolean isFileSupported(String fileName); static BiologicalDataItemFormat getFormatByExtension(String fileName); static String getFileExtension(String fileName); static boolean isFileBrowsingAllowed(BiologicalDataItemFormat format); static boolean isGzCompressed(String fileName); static boolean isRemotePath(String path); static final String GZ_EXTENSION; static final String TBI_EXTENSION; static final String IDX_EXTENSION; }