Package org.jboss.vfs

Class TempFileProvider

    • Method Detail

      • create

        public static TempFileProvider create​(String providerType,
                                              ScheduledExecutorService executor,
                                              boolean cleanExisting)
                                       throws IOException
        Create a temporary file provider for a given type.
        Parameters:
        providerType - The provider type string (used as a prefix in the temp file dir name)
        executor - Executor which will be used to manage temp file provider tasks (like cleaning up/deleting the temp files when needed)
        cleanExisting - If this is true, then this method will *try* to delete the existing temp content (if any) for the providerType. The attempt to delete the existing content (if any) will be done in the background and this method will not wait for the deletion to complete. The method will immediately return back with a usable TempFileProvider. Note that the cleanExisting will just act as a hint for this method to trigger the deletion of existing content. The method may not always be able to delete the existing contents.
        Returns:
        The new provider
        Throws:
        IOException - if an I/O error occurs
      • createTempDir

        public TempDir createTempDir​(String originalName)
                              throws IOException
        Create a temp directory, into which temporary files may be placed.
        Parameters:
        originalName - the original file name
        Returns:
        the temp directory
        Throws:
        IOException - for any error
      • finalize

        protected void finalize()
        Overrides:
        finalize in class Object