本文整理汇总了Java中org.fdroid.fdroid.Utils.symlinkOrCopyFileQuietly方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.symlinkOrCopyFileQuietly方法的具体用法?Java Utils.symlinkOrCopyFileQuietly怎么用?Java Utils.symlinkOrCopyFileQuietly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fdroid.fdroid.Utils
的用法示例。
在下文中一共展示了Utils.symlinkOrCopyFileQuietly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeFdroidApkToWebroot
import org.fdroid.fdroid.Utils; //导入方法依赖的package包/类
private String writeFdroidApkToWebroot() {
ApplicationInfo appInfo;
String fdroidClientURL = "https://f-droid.org/FDroid.apk";
try {
appInfo = pm.getApplicationInfo(fdroidPackageName, PackageManager.GET_META_DATA);
SanitizedFile apkFile = SanitizedFile.knownSanitized(appInfo.publicSourceDir);
SanitizedFile fdroidApkLink = new SanitizedFile(fdroidDir, "F-Droid.apk");
attemptToDelete(fdroidApkLink);
if (Utils.symlinkOrCopyFileQuietly(apkFile, fdroidApkLink)) {
fdroidClientURL = "/" + fdroidDir.getName() + "/" + fdroidApkLink.getName();
}
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Could not set up F-Droid apk in the webroot", e);
}
return fdroidClientURL;
}
示例2: copyApksToRepo
import org.fdroid.fdroid.Utils; //导入方法依赖的package包/类
private void copyApksToRepo(List<String> appsToCopy) {
for (final String packageName : appsToCopy) {
final App app = apps.get(packageName);
if (app.installedApk != null) {
SanitizedFile outFile = new SanitizedFile(repoDir, app.installedApk.apkName);
if (Utils.symlinkOrCopyFileQuietly(app.installedApk.installedFile, outFile)) {
continue;
}
}
// if we got here, something went wrong
throw new IllegalStateException("Unable to copy APK");
}
}
示例3: symlinkFileElsewhere
import org.fdroid.fdroid.Utils; //导入方法依赖的package包/类
private void symlinkFileElsewhere(String fileName, String symlinkPrefix, File directory) {
SanitizedFile index = new SanitizedFile(directory, fileName);
attemptToDelete(index);
Utils.symlinkOrCopyFileQuietly(new SanitizedFile(new File(directory, symlinkPrefix), fileName), index);
}