@Test public void testGetFileType_1() throws Exception { String fileName = ".zip"; FileNameUtils.ONSFileType result = FileNameUtils.getFileType(fileName); assertNotNull(result); assertEquals("ZIP", result.name()); assertEquals("ZIP", result.toString()); assertEquals(1, result.ordinal()); }
public static ONSFileType getFileType(String fileName) { if (fileName != null) { if (fileName.endsWith(ZIP)) { return ONSFileType.ZIP; } if (fileName.endsWith(TAR_GZ)) { return ONSFileType.TAR_GZ; } if (fileName.endsWith(".bin")) { return ONSFileType.BIN; } if (fileName.endsWith(".gz")) { return ONSFileType.GZ; } } return ONSFileType.INVALID; }
FileNameUtils { public static ONSFileType getFileType(String fileName) { if (fileName != null) { if (fileName.endsWith(ZIP)) { return ONSFileType.ZIP; } if (fileName.endsWith(TAR_GZ)) { return ONSFileType.TAR_GZ; } if (fileName.endsWith(".bin")) { return ONSFileType.BIN; } if (fileName.endsWith(".gz")) { return ONSFileType.GZ; } } return ONSFileType.INVALID; } }
FileNameUtils { public static ONSFileType getFileType(String fileName) { if (fileName != null) { if (fileName.endsWith(ZIP)) { return ONSFileType.ZIP; } if (fileName.endsWith(TAR_GZ)) { return ONSFileType.TAR_GZ; } if (fileName.endsWith(".bin")) { return ONSFileType.BIN; } if (fileName.endsWith(".gz")) { return ONSFileType.GZ; } } return ONSFileType.INVALID; }  }
FileNameUtils { public static ONSFileType getFileType(String fileName) { if (fileName != null) { if (fileName.endsWith(ZIP)) { return ONSFileType.ZIP; } if (fileName.endsWith(TAR_GZ)) { return ONSFileType.TAR_GZ; } if (fileName.endsWith(".bin")) { return ONSFileType.BIN; } if (fileName.endsWith(".gz")) { return ONSFileType.GZ; } } return ONSFileType.INVALID; }  static String getFileExtension(String fileName); static boolean isTarGz(String componentExtension); static boolean isZip(String componentExtension); static boolean isUnsupported(String componentExtension); static String convertToValidPath(String path); static String getName(String filename); static int indexOfLastSeparator(String filename); static String getDependencyFileName(String osName,
			String componentName); static String getInstallerFilePath(String osName,
			String componentName); static String getSciprtPath(String technology, String fileName); static String getParentFolderName(String folderPath); static ONSFileType getFileType(String fileName); static String getPathFromArchive(String archiveFile,
			String charSequence); static String getExtractedDirectoryName(String archiveFile); static String getComponentEnvFilePath(String componentName); }
FileNameUtils { public static ONSFileType getFileType(String fileName) { if (fileName != null) { if (fileName.endsWith(ZIP)) { return ONSFileType.ZIP; } if (fileName.endsWith(TAR_GZ)) { return ONSFileType.TAR_GZ; } if (fileName.endsWith(".bin")) { return ONSFileType.BIN; } if (fileName.endsWith(".gz")) { return ONSFileType.GZ; } } return ONSFileType.INVALID; }  static String getFileExtension(String fileName); static boolean isTarGz(String componentExtension); static boolean isZip(String componentExtension); static boolean isUnsupported(String componentExtension); static String convertToValidPath(String path); static String getName(String filename); static int indexOfLastSeparator(String filename); static String getDependencyFileName(String osName,
			String componentName); static String getInstallerFilePath(String osName,
			String componentName); static String getSciprtPath(String technology, String fileName); static String getParentFolderName(String folderPath); static ONSFileType getFileType(String fileName); static String getPathFromArchive(String archiveFile,
			String charSequence); static String getExtractedDirectoryName(String archiveFile); static String getComponentEnvFilePath(String componentName);  }