/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }
/** * Schedules this file to be automatically deleted when the VM terminates normally. * * <p><i>Note that on Android, the application lifecycle does not include VM termination, * so calling this method will not ensure that files are deleted</i>. Instead, you should * use the most appropriate out of: * <ul> * <li>Use a {@code finally} clause to manually invoke {@link #delete}. * <li>Maintain your own set of files to delete, and process it at an appropriate point * in your application's lifecycle. * <li>Use the Unix trick of deleting the file as soon as all readers and writers have * opened it. No new readers/writers will be able to access the file, but all existing * ones will still have access until the last one closes the file. * </ul> */ public void deleteOnExit() { DeleteOnExit.getInstance().addFile(getAbsolutePath()); }
/** * Returns our singleton instance, creating it if necessary. */ public static synchronized DeleteOnExit getInstance() { if (instance == null) { instance = new DeleteOnExit(); Runtime.getRuntime().addShutdownHook(instance); } return instance; }