org.springframework.boot

Class ApplicationHome



  • public class ApplicationHome
    extends Object
    Provides access to the application home directory. Attempts to pick a sensible home for both Jar Files, Exploded Archives and directly running applications.
    Since:
    1.2.0
    Author:
    Phillip Webb
    • Constructor Detail

      • ApplicationHome

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

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

      • getSource

        public File getSource()
        Returns the underlying source used to find the home directory. This is usually the jar file or a directory. Can return null if the source cannot be determined.
        Returns:
        the underlying source or null
      • getDir

        public File getDir()
        Returns the application home directory.
        Returns:
        the home directory (never null)

Copyright © 2019 Pivotal Software, Inc.. All rights reserved.