Class TempFileCreators


  • public final class TempFileCreators
    extends Object
    Factory for temporary files creators. A temporary file creator is a supplier that, when called, creates a temporary file and returns its path.
    Since:
    8.3.0
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • TempFileCreators

        public TempFileCreators()
    • Method Detail

      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator()
        Gets a creators that creates temporary files in the default temporary directory.
        Returns:
        The temporary file creator.
      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator​(String prefix,
                                                                             String suffix)
        Gets a creators that creates temporary files in the default temporary directory, but with the given prefix and suffix for the file name.
        Parameters:
        prefix - The prefix for the file name.
        suffix - The suffix for the file name.
        Returns:
        The temporary file creator.
      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator​(Path folder)
        Gets a creators that creates temporary files in the given folder.
        Parameters:
        folder - The folder in which to create the temporary files.
        Returns:
        The temporary file creator.
      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator​(String folder)
        Gets a creators that creates temporary files in the given folder.
        Parameters:
        folder - The folder in which to create the temporary files.
        Returns:
        The temporary file creator.
      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator​(Path folder,
                                                                             String prefix,
                                                                             String suffix)
        Gets a creators that creates temporary files in the given folder, and with the given prefix and suffix for the file name.
        Parameters:
        folder - The folder in which to create the temporary files.
        prefix - The prefix for the file name.
        suffix - The suffix for the file name.
        Returns:
        The temporary file creator.
      • newTempFileCreator

        public static ISerializableThrowingSupplier<Path> newTempFileCreator​(String folder,
                                                                             String prefix,
                                                                             String suffix)
        Gets a creators that creates temporary files in the given folder, and with the given prefix and suffix for the file name.
        Parameters:
        folder - The folder in which to create the temporary files.
        prefix - The prefix for the file name.
        suffix - The suffix for the file name.
        Returns:
        The temporary file creator.