當前位置: 首頁>>代碼示例>>Java>>正文


Java SanitizedFile.mkdir方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:29,代碼來源:LocalRepoManager.java

示例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);
    }
}
 
開發者ID:CmDnoEdition,項目名稱:fdroid,代碼行數:30,代碼來源:LocalRepoManager.java

示例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;
}
 
開發者ID:CmDnoEdition,項目名稱:fdroid,代碼行數:15,代碼來源:Utils.java


注:本文中的org.fdroid.fdroid.data.SanitizedFile.mkdir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。