Class ServerPaths

  • All Implemented Interfaces:
    CachePaths

    public class ServerPaths
    extends java.lang.Object
    implements CachePaths
    Provides information about TeamCity server working paths locations.
    • Field Detail

      • GLOBAL_ARTIFACTS_DIRECTORY_NAME

        public static final java.lang.String GLOBAL_ARTIFACTS_DIRECTORY_NAME
        See Also:
        Constant Field Values
      • SYSTEM_DIRECTORY_NAME

        public static final java.lang.String SYSTEM_DIRECTORY_NAME
        See Also:
        Constant Field Values
      • PLUGIN_DATA_DIRECTORY_NAME

        public static final java.lang.String PLUGIN_DATA_DIRECTORY_NAME
        See Also:
        Constant Field Values
      • CACHES_DIRECTORY_NAME

        public static final java.lang.String CACHES_DIRECTORY_NAME
        See Also:
        Constant Field Values
      • PROJECTS_DIR_NAME

        public static final java.lang.String PROJECTS_DIR_NAME
        See Also:
        Constant Field Values
      • ourSystemFolderName

        public static final java.lang.String ourSystemFolderName
        See Also:
        Constant Field Values
      • ourConfigFolderName

        public static final java.lang.String ourConfigFolderName
        See Also:
        Constant Field Values
      • ourBackupFolderName

        public static final java.lang.String ourBackupFolderName
        See Also:
        Constant Field Values
      • outImportFolderName

        public static final java.lang.String outImportFolderName
        See Also:
        Constant Field Values
      • ourLibFolderName

        public static final java.lang.String ourLibFolderName
        See Also:
        Constant Field Values
      • ourPluginsFolderName

        public static final java.lang.String ourPluginsFolderName
        See Also:
        Constant Field Values
      • ourBuildLogSubfolderName

        public static final java.lang.String ourBuildLogSubfolderName
        Name of the obsolete folder with build logs, inside the system folder.
        See Also:
        Constant Field Values
      • ourPersonalChangesSubfolderName

        public static final java.lang.String ourPersonalChangesSubfolderName
        Name of the folder with personal changes, inside the system folder.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ServerPaths

        public ServerPaths​(java.lang.String systemDir,
                           java.lang.String configDir,
                           java.lang.String backupDir,
                           java.lang.String importDir)
      • ServerPaths

        public ServerPaths​(@NotNull
                           java.lang.String rootDir)
        Creates an instance of ServerPath.
        Parameters:
        rootDir - the TeamCity Data Directory.
        See Also:
        ServerPaths(File)
      • ServerPaths

        public ServerPaths​(@NotNull
                           java.io.File rootDir)
        Creates an instance of ServerPath.
        Parameters:
        rootDir - the TeamCity Data Directory.
        Since:
        9.1
        See Also:
        ServerPaths(String)
    • Method Detail

      • setCachesDir

        public void setCachesDir​(@Nullable
                                 java.lang.String cachesDir)
      • isCustomCachesDir

        public boolean isCustomCachesDir()
        Returns:
        true if custom caches directory was specified
        Since:
        2020.1.1
      • getLogsPath

        @NotNull
        public java.io.File getLogsPath()
        Returns path to logs dir. In some cases logs dir may be changes by reconfiguring log4j.
        Returns:
        path to logs folder is it exists on null
      • getSystemDir

        public java.lang.String getSystemDir()
        Returns path to the TeamCity system directory. This directory contains build logs, artifacts, HSQLDB database files, and other non-configuration stuff. Usually, this is TEAMCITY_DATA_PATH/system, where TEAMCITY_DATA_PATH is specified as system property teamcity.data.path or environment variable TEAMCITY_DATA_PATH or $HOME/.BuildServer
        Returns:
        TeamCity system directory
      • getCachesDir

        public java.lang.String getCachesDir()
        Returns path to the TeamCity caches directory. Could be used to store caches for plugins or core services.
        Returns:
        TeamCity caches directory
      • getCacheDirectory

        @NotNull
        public java.io.File getCacheDirectory​(@NotNull
                                              java.lang.String name)
        Returns a directory to store caches
        Specified by:
        getCacheDirectory in interface CachePaths
        Parameters:
        name - name of cache
        Returns:
        existing directory to store caches
        Since:
        8.0
      • getConfigDir

        public java.lang.String getConfigDir()
        Returns path to the TeamCity configuration directory. This directory contains various settings of TeamCity, including description of projects, build configurations, and other settings. Usually, this is TEAMCITY_DATA_PATH/config, where TEAMCITY_DATA_PATH is specified as system property teamcity.data.path or environment variable TEAMCITY_DATA_PATH or $HOME/.BuildServer
        Returns:
        TeamCity configuration directory
      • getBackupDir

        public java.lang.String getBackupDir()
        Directory for backup TeamCity data.
        Returns:
        TeamCity backup directory.
      • getImportDir

        public java.lang.String getImportDir()
        Directory containing archives that can be used to import projects.
        Since:
        9.0
      • getProjectsDir

        @NotNull
        public java.io.File getProjectsDir()
        Returns:
        server projects directory path
        Since:
        8.0
      • getArtifactsDirectory

        @NotNull
        public java.io.File getArtifactsDirectory()
        Returns:
        default artifacts directory. Since 9.1 this method is only used to obtain default artifacts directory if no other directories are specified. To get all configured artifact directories, use jetbrains.buildServer.serverSide.ServerSettings#getArtifactDirectories() method
      • getPluginDataDirectory

        @NotNull
        public java.io.File getPluginDataDirectory()
        Returns TeamCity plugins data directory (root for all of the plugins).
      • getDataDirectory

        @NotNull
        public java.io.File getDataDirectory()
        Returns TeamCity data directory (root for all of the configuration directories).
        Returns:
        TeamCity data directory
      • getLibDir

        public java.lang.String getLibDir()
      • getPluginsDir

        public java.lang.String getPluginsDir()