Skip to content

修复文件只能保存到sdcard根目录,而不能直接保存到sdcard的某个文件夹下。 #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/net/tsz/afinal/http/entityhandler/FileEntityHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ public Object handleEntity(HttpEntity entity, EntityCallBack callback,String tar

File targetFile = new File(target);

/*
* 目标路径支持保存到sdcard的某个自定义文件夹下
* 修改日期:2014-04-09 15:50
* 修改者:ShelWee
*/
if (!targetFile.exists()) {
String tmpDirectory = targetFile.getAbsolutePath();
File f = new File(tmpDirectory.substring(0, tmpDirectory.lastIndexOf(File.separator) ));
if(!f.exists()) f.mkdirs();
targetFile.createNewFile();
}

Expand Down