1 /* Copyright (C) 2000 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 package gnu
.gcj
.runtime
;
14 public final class FileDeleter
16 public synchronized static void add (File f
)
18 if (deleteOnExitStack
== null)
19 deleteOnExitStack
= new Stack ();
21 deleteOnExitStack
.push (f
);
24 // Helper method called by java.lang.Runtime.exit() to perform
26 public synchronized static void deleteOnExitNow ()
28 if (deleteOnExitStack
!= null)
29 while (!deleteOnExitStack
.empty ())
30 ((File
)(deleteOnExitStack
.pop ())).delete ();
33 // A stack of files to delete upon normal termination.
34 private static Stack deleteOnExitStack
;