public class FileUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
copyFile(java.io.FileInputStream fileInputStream,
java.lang.String outFilePath)
Copies one file into the other with the given paths.
|
static java.lang.String |
extSuffix(java.io.InputStream input) |
static java.lang.String |
getCreateFileName(java.lang.String prefix)
根据时间戳创建文件名
|
static java.lang.String |
getDataColumn(android.content.Context context,
android.net.Uri uri,
java.lang.String selection,
java.lang.String[] selectionArgs)
Get the value of the data column for this Uri.
|
static java.lang.String |
getPath(android.content.Context context,
android.net.Uri uri)
Get a file path from a Uri.
|
static boolean |
isDownloadsDocument(android.net.Uri uri) |
static boolean |
isExternalStorageDocument(android.net.Uri uri) |
static boolean |
isGif(java.lang.String mimeType)
是否是gif
|
static boolean |
isGifForSuffix(java.lang.String suffix) |
static boolean |
isGooglePhotosUri(android.net.Uri uri) |
static boolean |
isHttp(java.lang.String path)
是否是网络图片
|
static boolean |
isMediaDocument(android.net.Uri uri) |
public static boolean isExternalStorageDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isDownloadsDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isMediaDocument(android.net.Uri uri)
uri
- The Uri to check.public static boolean isGooglePhotosUri(android.net.Uri uri)
uri
- The Uri to check.public static java.lang.String getDataColumn(android.content.Context context, android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)
context
- The context.uri
- The Uri to query.selection
- (Optional) Filter used in the query.selectionArgs
- (Optional) Selection arguments used in the query.public static java.lang.String getPath(android.content.Context context, android.net.Uri uri)
context
- The context.uri
- The Uri to query.public static boolean isGifForSuffix(java.lang.String suffix)
public static boolean isGif(java.lang.String mimeType)
mimeType
- public static boolean isHttp(java.lang.String path)
path
- public static boolean copyFile(java.io.FileInputStream fileInputStream, java.lang.String outFilePath)
public static java.lang.String extSuffix(java.io.InputStream input)
public static java.lang.String getCreateFileName(java.lang.String prefix)
prefix
- 前缀名