安卓 StorageUtils

安卓 StorageUtils,第1张

安卓 StorageUtils
public class StorageUtils {

    public static String DIRECTORY_MUSIC = "Music";
    public static String DIRECTORY_ALARMS = "Alarms";
    public static String DIRECTORY_NOTIFICATIONS = "Notifications";
    public static String DIRECTORY_PICTURES = "Pictures";
    public static String DIRECTORY_PICTURES_LUBAN = "Picturesluban";
    public static String DIRECTORY_MOVIES = "Movies";
    public static String DIRECTORY_DOWNLOADS = "Download";
    public static String DIRECTORY_DCIM = "DCIM";
    public static String DIRECTORY_documentS = "documents";
    public static String DIRECTORY_DOWNAPK = "apk";



    public static String getDirectoryMusic(Context context){
        return context.getExternalFilesDir(DIRECTORY_MUSIC).getAbsolutePath();
    }
    public static String getDirectoryAlarms(Context context){
        return context.getExternalFilesDir(DIRECTORY_ALARMS).getAbsolutePath();
    }
    public static String getDirectoryNotifications(Context context){
        return context.getExternalFilesDir(DIRECTORY_NOTIFICATIONS).getAbsolutePath();
    }
    public static String getDirectoryPictures(Context context){
        return context.getExternalFilesDir(DIRECTORY_PICTURES).getAbsolutePath();
    }
    public static String getDirectoryPicturesLuban(Context context){
        return context.getExternalFilesDir(DIRECTORY_PICTURES_LUBAN).getAbsolutePath();
    }
    public static String getDirectoryMovies(Context context){
        return context.getExternalFilesDir(DIRECTORY_MOVIES).getAbsolutePath();
    }
    public static String getDirectorydocuments(Context context){
        return context.getExternalFilesDir(DIRECTORY_documentS).getAbsolutePath();
    }
    public static String getDirectoryDcim(Context context){
        return context.getExternalFilesDir(DIRECTORY_DCIM).getAbsolutePath();
    }

    public static String getDirectoryDownloads(Context context){
        return context.getExternalFilesDir(DIRECTORY_DOWNLOADS).getAbsolutePath();
    }
    public static String getDirectoryDownapk(Context context){
        return context.getExternalFilesDir(DIRECTORY_DOWNAPK).getAbsolutePath();
    }
}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5708142.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存