Package io.rong.imkit.utils

## Class KitStorageUtils

- All Implemented Interfaces:

      public class KitStorageUtils

  Created by Android Studio. User: lvhongzhen Date: 2019-11-28 Time: 11:43

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public class` | `KitStorageUtils.MediaType` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---

  - ### Constructor Summary

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

  - ### Enum Constant Summary

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

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `static boolean` | `isScopedStorageMode(Context context)` |
    `static boolean` | `isBuildAndTargetForQ(Context context)` |
    `static String` | `getImageSavePath(Context context)` |
    `static String` | `getVideoSavePath(Context context)` |
    `static String` | `getFileSavePath(Context context)` |
    `static String` | `getSavePath(Context context, String type, int res)` |
    `static void` | `updatePhotoMedia(File file, Context context)` |
    `static Uri` | `insertImageIntoMediaStore(Context context, String fileName, String mimeType)` |
    `static Uri` | `insertVideoIntoMediaStore(Context context, String fileName)` |
    `static void` | `writeToPublicDir(File pFile, ParcelFileDescriptor pParcelFileDescriptor)` |
    `static void` | `read(ParcelFileDescriptor parcelFileDescriptor, File dst)` |
    `static void` | `copy(FileInputStream ist, FileOutputStream ost)` |
    `static String` | `getImgMimeType(File imgFile)` |
    `Uri` | `getContentUri(int type, String id)` |
    `InputStream` | `getFileInputStreamWithUri(Context pContext, Uri pUri)` |
    `static boolean` | `saveMediaToPublicDir(Context context, File file, String type)` |
    `static boolean` | `saveMediaToPublicDir(Context context, File file, String outputFileName, String type)` |

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

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

- - ### Constructor Detail

    - #### KitStorageUtils

          KitStorageUtils()

  - ### Method Detail

    - #### isScopedStorageMode

           static boolean isScopedStorageMode(Context context)

    - #### isBuildAndTargetForQ

           static boolean isBuildAndTargetForQ(Context context)

    - #### getImageSavePath

           static String getImageSavePath(Context context)

    - #### getVideoSavePath

           static String getVideoSavePath(Context context)

    - #### getFileSavePath

           static String getFileSavePath(Context context)

    - #### getSavePath

           static String getSavePath(Context context, String type, int res)

    - #### updatePhotoMedia

           static void updatePhotoMedia(File file, Context context)

    - #### insertImageIntoMediaStore

           static Uri insertImageIntoMediaStore(Context context, String fileName, String mimeType)

    - #### insertVideoIntoMediaStore

           static Uri insertVideoIntoMediaStore(Context context, String fileName)

    - #### writeToPublicDir

           static void writeToPublicDir(File pFile, ParcelFileDescriptor pParcelFileDescriptor)

    - #### read

           static void read(ParcelFileDescriptor parcelFileDescriptor, File dst)

    - #### copy

           static void copy(FileInputStream ist, FileOutputStream ost)

    - #### getImgMimeType

           static String getImgMimeType(File imgFile)

    - #### getContentUri

           Uri getContentUri(int type, String id)

      Parameters:
        `type` - MediaStore类型，0：Images，1：Video，2：Audio
        `id` - 通过扫描获取到的MediaStore."xxx".Media.
      Returns:

        content uri

    - #### getFileInputStreamWithUri

           InputStream getFileInputStreamWithUri(Context pContext, Uri pUri)

    - #### saveMediaToPublicDir

           static boolean saveMediaToPublicDir(Context context, File file, String type)

      Parameters:
        `context` - 上下文
        `file` - 文件
        `type` - KitStorageUtils.
      Returns:

        保存媒体数据到公有目录返回结果

    - #### saveMediaToPublicDir

           static boolean saveMediaToPublicDir(Context context, File file, String outputFileName, String type)

      Parameters:
        `context` - 上下文
        `file` - 文件
        `outputFileName` - 输出的文件名，不包含路径
        `type` - KitStorageUtils.
      Returns:

        保存媒体数据到公有目录返回结果