/** * Client applications should not call directly. Call BeaconManager#setRegionStatePeristenceEnabled */ public synchronized void stopStatusPreservation() { mContext.deleteFile(STATUS_PRESERVATION_FILE_NAME); this.mStatePreservationIsOn = false; }
@Override public boolean deleteFile(String name) { return mBase.deleteFile(name); }
public synchronized void clear() { mContext.deleteFile(STATUS_PRESERVATION_FILE_NAME); getRegionsStateMap().clear(); }
} finally { Utility.closeQuietly(ois); context.deleteFile(PERSISTED_SESSION_INFO_FILENAME); if (appSessionInfoMap == null) { appSessionInfoMap =
@Test public void deleteFile_shouldReturnFalse() throws IOException { File filesDir = context.getFilesDir(); File file = new File(filesDir, "test.txt"); boolean successfully = context.deleteFile(file.getName()); assertThat(successfully).isFalse(); }
@Test public void deleteFile_shouldReturnTrue() throws IOException { File filesDir = context.getFilesDir(); File file = new File(filesDir, "test.txt"); boolean successfully = file.createNewFile(); assertThat(successfully).isTrue(); successfully = context.deleteFile(file.getName()); assertThat(successfully).isTrue(); }
if (getRegionsStateMap().size() > MAX_REGIONS_FOR_STATUS_PRESERVATION) { LogManager.w(TAG, "Too many regions being monitored. Will not persist region state"); mContext.deleteFile(STATUS_PRESERVATION_FILE_NAME);
@Override public boolean deleteFile(String name) { return mBase.deleteFile(name); }
private void deleteCrashReport() { appCtx.deleteFile(CRASHREPORT); }
context.deleteFile(QUEST_ICONS_FILE); FileOutputStream spriteSheetIconsFile = context.openFileOutput(QUEST_ICONS_FILE, Context.MODE_PRIVATE); spriteSheet.compress(Bitmap.CompressFormat.PNG, 0, spriteSheetIconsFile);
context.deleteFile(BOGUS_FILE_NAME);
context.deleteFile(BOGUS_FILE_NAME);
/** * Delete the given private file associated with this Context's application package. * * @param context {@link Context} * @param name The name of the file to delete; can not contain path separators. * @return true if the file was successfully deleted; else false. * @since 1.0.1 */ public static boolean deleteFile(Context context, String name) { return context.deleteFile(name); } }
/** * 删除工程目录下指定文件 */ public static boolean deleteWithProject(Context context, String fileName) { if (null != context) { return context.deleteFile(fileName); } return false; }
public static boolean deleteSessionPartnerParameters(Context context) { return context.deleteFile(SESSION_PARTNER_PARAMETERS_FILENAME); }
@Override public void error(Exception e, int loopCount) { // avoid game not starting anymore because of a somehow corrupt saved game file if (loopCount < 10) { Log.w(TAG, "Game crashed just after loading, deleting saved game file."); mContext.deleteFile(SAVED_GAME_FILE); } }
public void cleanup(String file) { Context context = Registry.getActiveInstance().getContext(); file = file.substring("file:///".length()); context.deleteFile(file); } }
public void removeProfile(Context context, VpnProfile profile) { String vpnentry = profile.getUUID().toString(); profiles.remove(vpnentry); saveProfileList(context); context.deleteFile(vpnentry + ".vp"); if (mLastConnectedVpn == profile) mLastConnectedVpn = null; } }
public static void deleteBitmap(Context context, ComponentName cname, IconType iconType) { String fname = makeSafeName(cname, iconType); if (fileExists(context, fname)) { context.deleteFile(fname); } }
@Test public void testReadFromFileWhenNull() { final String fileName = "protoUtilsReadFromFileWhenNull"; final Context context = RuntimeEnvironment.application; context.deleteFile(fileName); final SettingsProto.Settings read = ProtoUtils.readFromFile( context, fileName, new SettingsProto.Settings()); assertNull(read); }