FileUtils { public static boolean isGif(String path) { if (path == null) return false; int pathLen = path.length(); try{ return (".GIF".equals(path.substring(pathLen - 4, pathLen).toUpperCase())); }catch (Exception e) { e.printStackTrace(); return false; } } private  FileUtils(); static String getAppCacheDir(); static boolean isGif(String path); @TargetApi(19) static String getImageAbsolutePath(Activity context, Uri imageUri); static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs); static boolean isExternalStorageDocument(Uri uri); static boolean isDownloadsDocument(Uri uri); static boolean isMediaDocument(Uri uri); static boolean isGooglePhotosUri(Uri uri); static double formatSize(long size, SizeType type); static String formatSize(long size); static File[] getAllCacheFile(); static Observable<File> listFiles(File f);  }
@Test public void isGif() throws Exception { System.out.println(FileUtils.isGif("")); }