Package io.rong.imkit.utils

## Class FileTypeUtils

- All Implemented Interfaces:

      public class FileTypeUtils

  Created by tiankui on 16/7/27.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public final class` | `FileTypeUtils.FileTypeFilter` |
    `public class` | `FileTypeUtils.FileNameComparator` | 根据文件名进行比较排序

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `public final static FileFilter` | `ALL_FOLDER_AND_FILES_FILTER` |
    `public final static int` | `KILOBYTE` |
    `public final static int` | `MEGABYTE` |
    `public final static int` | `GIGABYTE` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FileTypeUtils()` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `static int` | `fileTypeImageId(Context context, String fileName)` |
    `static Intent` | `getOpenFileIntent(Context context, String fileName, String fileSavePath)` |
    `static Intent` | `getOpenFileIntent(Context context, String fileName, Uri uri)` |
    `static List<FileInfo>` | `getTextFilesInfo(Context context, File fileDir)` |
    `static List<FileInfo>` | `getVideoFilesInfo(Context context, File fileDir)` |
    `static List<FileInfo>` | `getAudioFilesInfo(Context context, File fileDir)` |
    `static List<FileInfo>` | `getOtherFilesInfo(Context context, File fileDir)` |
    `static List<FileInfo>` | `getFileInfosFromFileArray(Array<File> files)` |
    `static int` | `getNumFilesInFolder(FileInfo fileInfo)` | 获取文件夹中文件的个数
    `static String` | `formatFileSize(long size)` | 将文件的大小转换成便于认识的字符串
    `static Array<String>` | `getExternalStorageDirectories(Context context)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FileTypeUtils

          FileTypeUtils()

  - ### Method Detail

    - #### fileTypeImageId

           static int fileTypeImageId(Context context, String fileName)

    - #### getOpenFileIntent

           static Intent getOpenFileIntent(Context context, String fileName, String fileSavePath)

    - #### getOpenFileIntent

           static Intent getOpenFileIntent(Context context, String fileName, Uri uri)

    - #### getTextFilesInfo

           static List<FileInfo> getTextFilesInfo(Context context, File fileDir)

    - #### getVideoFilesInfo

           static List<FileInfo> getVideoFilesInfo(Context context, File fileDir)

    - #### getAudioFilesInfo

           static List<FileInfo> getAudioFilesInfo(Context context, File fileDir)

    - #### getOtherFilesInfo

           static List<FileInfo> getOtherFilesInfo(Context context, File fileDir)

    - #### getFileInfosFromFileArray

           static List<FileInfo> getFileInfosFromFileArray(Array<File> files)

    - #### getNumFilesInFolder

           static int getNumFilesInFolder(FileInfo fileInfo)

      获取文件夹中文件的个数

      Parameters:
        `fileInfo` - 文件信息
      Returns:

        文件夹中文件的个数

    - #### formatFileSize

           static String formatFileSize(long size)

      将文件的大小转换成便于认识的字符串

    - #### getExternalStorageDirectories

           static Array<String> getExternalStorageDirectories(Context context)