文件,图片,视频的保存路径

public class PathManager {
    //自定义相机存储路径(图片经过剪裁后的图片,生成640*640)
    public static File getCropPhotoPath() {
        File photoFile = new File(getCropPhotoDir(),System.currentTimeMillis() + ".jpg");
        return photoFile;
    }

    //存储剪裁后的图片的文件夹
    public static File getCropPhotoDir() {
        String path = Environment.getExternalStorageDirectory()
                + "/etourypic";
        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        }
        return file;
    }
    //存储拍照完成的页面
    public static File getVideoPath(){
        File videoFile = new File(getVideoDir(),System.currentTimeMillis() + ".3gp");
        return videoFile;
    }
    public static File getVideoDir() {
        String path = Environment.getExternalStorageDirectory()
                + "/etouryvideo";
        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        }
        return file;
    }
}
posted @ 2015-12-10 15:02  Pace千雨  阅读(534)  评论(0编辑  收藏  举报