org.springframework.boot.system

Class ApplicationTemp



  • public class ApplicationTemp
    extends Object
    Provides access to an application specific temporary directory. Generally speaking different Spring Boot applications will get different locations, however, simply restarting an application will give the same location.
    Since:
    2.0.0
    Author:
    Phillip Webb
    • Constructor Detail

      • ApplicationTemp

        public ApplicationTemp()
        Create a new ApplicationTemp instance.
      • ApplicationTemp

        public ApplicationTemp(Class<?> sourceClass)
        Create a new ApplicationTemp instance for the specified source class.
        Parameters:
        sourceClass - the source class or null
    • Method Detail

      • getDir

        public File getDir(String subDir)
        Return a sub-directory of the application temp.
        Parameters:
        subDir - the sub-directory name
        Returns:
        a sub-directory
      • getDir

        public File getDir()
        Return the directory to be used for application specific temp files.
        Returns:
        the application temp directory