Interface StorageLocationService

All Known Implementing Classes:
StorageLocationServiceImpl

public interface StorageLocationService
Methods for determining the storage location of various types of persistent data related to builds and deployments, such as artifacts, logs and build results.
  • Method Details

    • getRootBuildDataDirectory

      File getRootBuildDataDirectory()
      Returns the root build data directory for all plans and deployment projects.
    • getBuildDataDirectory

      File getBuildDataDirectory(Key key)
      Returns the top level build data directory for a plan or deployment project. This is the common parent directory for storing build and deployment metadata related to the plan or project. Build results and logs are stored in subdirectories under this directory. Eg. ".../xml-data/builds/plan-12345-JOB1/"
    • getBuildResultsDirectory

      File getBuildResultsDirectory(Key buildKey)
      Eg. ".../xml-data/builds/plan-12345-JOB1/results/"
    • getBuildDownloadDataDirectory

      File getBuildDownloadDataDirectory(Key key)
      Returns the "download data" directory for a plan or deployment project. Eg. ".../xml-data/builds/plan-12345-JOB1/download-data/"
    • getBuildLogsDirectory

      File getBuildLogsDirectory(Key key)
      Eg. ".../xml-data/builds/plan-12345-JOB1/download-data/build_logs/"
    • getLogFileName

      @Deprecated String getLogFileName(@NotNull @NotNull Key entityKey, int resultNumber)
      Deprecated.
      Returns the standard name of the log file for the specified build or deployment.
    • getLogFileName

      String getLogFileName(@NotNull @NotNull Key entityKey, long resultNumber)
      Returns the standard name of the log file for the specified build or deployment.
    • getLogFileName

      String getLogFileName(ResultKey resultKey)
      Returns the standard name of the log file for the specified build or deployment.
    • getLogFile

      @Deprecated File getLogFile(Key entityKey, int resultNumber)
      Deprecated.
      since 6.5 use getLogFile(Key, long)
      Returns the location of the log file for the specified build or deployment.
    • getLogFile

      File getLogFile(Key entityKey, long resultNumber)
      Returns the location of the log file for the specified build or deployment.
    • getLogFile

      File getLogFile(ResultKey resultKey)
      Returns the location of the log file for the specified build or deployment.
    • getLogFile

      File getLogFile(@NotNull @NotNull ResultKey resultKey, @Nullable @Nullable String suffix)
      Returns the location of the log file for the specified build or deployment. Optional suffix parameter allows getting logs from previous runs.
      Since:
      7.2
    • getArtifactPathBuilder

      ArtifactPathBuilder getArtifactPathBuilder(String rootArtifactPath, char separatorChar)
      Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts. This version of the method takes a rootArtifactPath parameter, returning an instance that builds absolute paths.
    • getArtifactPathBuilder

      ArtifactPathBuilder getArtifactPathBuilder(char separatorChar)
      Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts. This version of the method returns an instance that builds relative paths, not absolute paths. All the paths produced by this builder must be appended to a root artifact storage location before being used to locate artifacts.
    • getArtifactDirectoryBuilder

      ArtifactDirectoryBuilder getArtifactDirectoryBuilder(File rootArtifactDirectory)
      Returns an ArtifactDirectoryBuilder which can be used to build File objects pointing to artifacts stored on the local filesystem. This version of the method takes a rootArtifactDirectory parameter.
    • getDefaultArtifactDirectoryBuilder

      ArtifactDirectoryBuilder getDefaultArtifactDirectoryBuilder()
      Returns the default ArtifactDirectoryBuilder which can be used to build File objects pointing to artifacts stored on the local filesystem in the default location. This method is only available to code running on the server, not on remote agents (remote agents never store artifacts on the local filesystem).
    • renameOldBuildLogsIfNeeded

      void renameOldBuildLogsIfNeeded(@NotNull @NotNull ResultKey resultKey)
      Makes sure that build log file for the current result is empty, by renaming any pre-existing build logs.
      Since:
      7.2
    • getOldLogsFileNames

      List<String> getOldLogsFileNames(@NotNull @NotNull ResultKey resultKey)
      If a result has logs from previous runs, return their filenames sorted by age (newest first). See also renameOldBuildLogsIfNeeded(ResultKey)
      Since:
      7.2
    • getLogsFileNames

      List<String> getLogsFileNames(@NotNull @NotNull ResultKey resultKey)
      Return all log filenames sorted by age (newest first).
      Since:
      7.2