# FileTypeUtils

public class FileTypeUtils

Created by tiankui on 16/7/27.

## Constructors

FileTypeUtils
Link copied to clipboard
public void FileTypeUtils()

## Types

FileNameComparator
Link copied to clipboard
public class FileNameComparator implements Comparator<T>
根据文件名进行比较排序
FileTypeFilter
Link copied to clipboard
public final class FileTypeFilter implements FileFilter

## Properties

ALL_FOLDER_AND_FILES_FILTER
Link copied to clipboard
public final static FileFilter ALL_FOLDER_AND_FILES_FILTER
文件过滤,将手机中隐藏的文件给过滤掉
GIGABYTE
Link copied to clipboard
public final static int GIGABYTE
KILOBYTE
Link copied to clipboard
public final static int KILOBYTE
文件管理器中文件列表图标显示:根据文件的类型来获取文件的图标
MEGABYTE
Link copied to clipboard
public final static int MEGABYTE

## Functions

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