本文整理汇总了Java中info.guardianproject.iocipher.File.mkdirs方法的典型用法代码示例。如果您正苦于以下问题:Java File.mkdirs方法的具体用法?Java File.mkdirs怎么用?Java File.mkdirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.guardianproject.iocipher.File
的用法示例。
在下文中一共展示了File.mkdirs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDirectory
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
private static File createDirectory(File f) {
if (f.exists() && f.isDirectory()) {
return f;
}
f.mkdirs();
return f;
}
示例2: mkdirs
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
private static void mkdirs(String targetPath) throws IOException {
File targetFile = new File(targetPath);
if (!targetFile.exists()) {
File dirFile = targetFile.getParentFile();
if (!dirFile.exists()) {
boolean created = dirFile.mkdirs();
if (!created) {
throw new IOException("Error creating " + targetPath);
}
}
}
}
示例3: takePic
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
void takePic() {
Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imagesFolder = new File(Environment.getExternalStorageDirectory(), "MyImages");
//File imagesFolder = new File(Environment.getExternalStorageDirectory(), "MyImages");
//java.io.File imagesFolder = new java.io.File("/data/data/info.guardianproject.securecamtest/");
// java.io.File imagesFolder = new java.io.File("/storage/sdcard0/DCIM/");
// java.io.File imagesFolder = new java.io.File(Environment.DIRECTORY_DCIM);
imagesFolder.mkdirs();
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File imageFile = new File(imagesFolder, "securecam_"+ timeStamp + ".jpg");
imageStreamFile = new StreamFile(imageFile.getAbsolutePath());
Log.d(TAG, "vfs file: " + imageFile.getAbsolutePath());
Uri uriStreamFile = Uri.fromFile(imageStreamFile.getJavaIoFile());
Log.d(TAG, "pipe uri: " + uriStreamFile);
imageStreamFile.startWriteToVFS();
// java.io.File file = new java.io.File(imageFile.getAbsolutePath());
// imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, file);
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriStreamFile);
startActivityForResult(imageIntent, 0);
// FIXME close imageStreamFile in result handler
/*
Pipes.createfifonative();
Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
java.io.File dir=
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
java.io.File output=new File(dir, "CameraContentDemo.jpeg");
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(output));
Log.d("foo", "uri: " + Uri.fromFile(output));
startActivityForResult(i, 0);
*/
}
示例4: FileHierarchy
import info.guardianproject.iocipher.File; //导入方法依赖的package包/类
FileHierarchy(File basePath) {
this.basePath = basePath;
basePath.mkdirs();
}