Class TempFileList


  • @Deprecated
    public class TempFileList
    extends Object
    Deprecated.
    Please use TempFileContext as File.deleteOnExit() is prone to memory leaks in long-running applications.
    Manages a set of temporary files. When a context is completed, all temporary files created within that context may be deleted by calling delete on its list.

    For example, a context might be the lifecycle of serving one HTTP request. Once the request has been completed, any temporary files created should be cleaned-up immediately instead of waiting an indeterminate amount of time for

    Author:
    AO Industries, Inc.
    See Also:
    TempFile
    • Constructor Detail

      • TempFileList

        public TempFileList​(String prefix)
        Deprecated.
      • TempFileList

        public TempFileList​(String prefix,
                            String suffix)
        Deprecated.
      • TempFileList

        public TempFileList​(String prefix,
                            String suffix,
                            File directory)
        Deprecated.
    • Method Detail

      • createTempFile

        public TempFile createTempFile()
                                throws IOException
        Deprecated.
        Creates a new temp file while adding it to the list of files that will be explicitly deleted when this list is deleted.
        Throws:
        IOException
      • delete

        public void delete()
                    throws IOException
        Deprecated.
        Deletes all of the underlying temp files immediately.

        This list may still be used for additional temp files.

        Throws:
        IOException
        See Also:
        TempFile.delete()