Class SharedTemporaryFiles


  • public class SharedTemporaryFiles
    extends Object
    • Method Detail

      • create

        public static File create​(@NotNull
                                  @NotNull SharedTemporaryFiles.SharedTemporaryFileSpec temporaryFileSpec)
                           throws IOException
        Returns a file with given prefix, suffix and content in the specified directory. If the file already exists and was not created using this method, it's first deleted, otherwise an existing handle will be returned and no I/O will take place. Do not cache the returned reference or file name for a long time: the file will exist for 5 minutes after the call to this method is made. Repeated calls to this method with the same parameters reset the remaining file lifetime to 5 minutes.
        Parameters:
        temporaryFileSpec - temporary file specs
        Returns:
        handle to the file
        Throws:
        IOException