在android的sd卡中能创建文件但是不能创建文件夹如何解决

在android的sd卡中能创建文件但是不能创建文件夹怎么解决
各位高烧怎么在sd卡中能创建文件就是不能创建文件夹呢?权限我全加上了
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

public static void checkedAndSaveFile(String fileName,String data,String path){
InputStream inputStream = new java.io.ByteArrayInputStream(StringUtil.fromBase64(data));
String savePath = path.trim();
savePath = savePath.replace("\\", "/");
String saveFileName = fileName.trim();
String saveFilePathAndName = savePath+File.separator+saveFileName;
Log.i("dir======================>", saveFilePathAndName);
saveFilePathAndName=saveFilePathAndName.trim();
File newFile = new File(saveFilePathAndName);
File fileDir = new File(savePath);
if(!fileDir.exists()){
fileDir.mkdir();
}
//
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "test.txt");
try {
file.createNewFile();
} catch (IOException e1) {
e1.printStackTrace();
}
//
if(!newFile.exists())
try {
newFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
if(checkSDCard()){
save(saveFilePathAndName, inputStream, newFile);
}
}

public static void save(String fileName,InputStream inputStream,File file){

FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
byte[] buffer = new byte[512];
int len;
int downloader = 0;
while ((len = inputStream.read(buffer)) != -1) {
fos.write(buffer, 0, len);
downloader += len;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally{
try {
fos.flush();
fos.close();
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

------解决方案--------------------
if(!fileDir.exists()){
 fileDir.mkdir();
 }

fileDir.mkdirs();
------解决方案--------------------
如果目录的上一级目录不存在的话,mkdir()会失败
要确保创建目录成功,最好使用 mkdirs()来创建