本文整理匯總了Java中org.fdroid.fdroid.data.SanitizedFile.mkdir方法的典型用法代碼示例。如果您正苦於以下問題:Java SanitizedFile.mkdir方法的具體用法?Java SanitizedFile.mkdir怎麽用?Java SanitizedFile.mkdir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.fdroid.fdroid.data.SanitizedFile
的用法示例。
在下文中一共展示了SanitizedFile.mkdir方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LocalRepoManager
import org.fdroid.fdroid.data.SanitizedFile; //導入方法依賴的package包/類
private LocalRepoManager(Context c) {
context = c.getApplicationContext();
pm = c.getPackageManager();
assetManager = c.getAssets();
fdroidPackageName = c.getPackageName();
webRoot = SanitizedFile.knownSanitized(c.getFilesDir());
/* /fdroid/repo is the standard path for user repos */
fdroidDir = new SanitizedFile(webRoot, "fdroid");
fdroidDirCaps = new SanitizedFile(webRoot, "FDROID");
repoDir = new SanitizedFile(fdroidDir, "repo");
repoDirCaps = new SanitizedFile(fdroidDirCaps, "REPO");
iconsDir = new SanitizedFile(repoDir, "icons");
xmlIndexJar = new SanitizedFile(repoDir, "index.jar");
xmlIndexJarUnsigned = new SanitizedFile(repoDir, "index.unsigned.jar");
if (!fdroidDir.exists() && !fdroidDir.mkdir()) {
Log.e(TAG, "Unable to create empty base: " + fdroidDir);
}
if (!repoDir.exists() && !repoDir.mkdir()) {
Log.e(TAG, "Unable to create empty repo: " + repoDir);
}
if (!iconsDir.exists() && !iconsDir.mkdir()) {
Log.e(TAG, "Unable to create icons folder: " + iconsDir);
}
}
示例2: LocalRepoManager
import org.fdroid.fdroid.data.SanitizedFile; //導入方法依賴的package包/類
private LocalRepoManager(Context c) {
context = c.getApplicationContext();
pm = c.getPackageManager();
assetManager = c.getAssets();
fdroidPackageName = c.getPackageName();
webRoot = SanitizedFile.knownSanitized(c.getFilesDir());
/* /fdroid/repo is the standard path for user repos */
fdroidDir = new SanitizedFile(webRoot, "fdroid");
fdroidDirCaps = new SanitizedFile(webRoot, "FDROID");
repoDir = new SanitizedFile(fdroidDir, "repo");
repoDirCaps = new SanitizedFile(fdroidDirCaps, "REPO");
iconsDir = new SanitizedFile(repoDir, "icons");
xmlIndex = new SanitizedFile(repoDir, "index.xml");
xmlIndexJar = new SanitizedFile(repoDir, "index.jar");
xmlIndexJarUnsigned = new SanitizedFile(repoDir, "index.unsigned.jar");
if (!fdroidDir.exists() && !fdroidDir.mkdir()) {
Log.e(TAG, "Unable to create empty base: " + fdroidDir);
}
if (!repoDir.exists() && !repoDir.mkdir()) {
Log.e(TAG, "Unable to create empty repo: " + repoDir);
}
if (!iconsDir.exists() && !iconsDir.mkdir()) {
Log.e(TAG, "Unable to create icons folder: " + iconsDir);
}
}
示例3: getApkCacheDir
import org.fdroid.fdroid.data.SanitizedFile; //導入方法依賴的package包/類
/**
* This location is only for caching, do not install directly from this location
* because if the file is on the External Storage, any other app could swap out
* the APK while the install was in process, allowing malware to install things.
* Using {@link org.fdroid.fdroid.installer.Installer#installPackage(File, String, String)}
* is fine since that does the right thing.
*/
public static SanitizedFile getApkCacheDir(Context context) {
final SanitizedFile apkCacheDir = new SanitizedFile(StorageUtils.getCacheDirectory(context, true), "apks");
if (!apkCacheDir.exists()) {
apkCacheDir.mkdir();
}
return apkCacheDir;
}