Package com.atlassian.bamboo.storage
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 Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ArtifactDirectoryBuilder
getArtifactDirectoryBuilder(File rootArtifactDirectory)
Returns an ArtifactDirectoryBuilder which can be used to buildFile
objects pointing to artifacts stored on the local filesystem.ArtifactPathBuilder
getArtifactPathBuilder(char separatorChar)
Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts.ArtifactPathBuilder
getArtifactPathBuilder(String rootArtifactPath, char separatorChar)
Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts.File
getBuildDataDirectory(Key key)
Returns the top level build data directory for a plan or deployment project.File
getBuildDownloadDataDirectory(Key key)
Returns the "download data" directory for a plan or deployment project.File
getBuildLogsDirectory(Key key)
Eg.File
getBuildResultsDirectory(Key buildKey)
Eg.ArtifactDirectoryBuilder
getDefaultArtifactDirectoryBuilder()
Returns the default ArtifactDirectoryBuilder which can be used to buildFile
objects pointing to artifacts stored on the local filesystem in the default location.File
getLogFile(@NotNull ResultKey resultKey, @Nullable String suffix)
Returns the location of the log file for the specified build or deployment.File
getLogFile(Key entityKey, int resultNumber)
Deprecated.since 6.5 usegetLogFile(Key, long)
File
getLogFile(Key entityKey, long resultNumber)
Returns the location of the log file for the specified build or deployment.File
getLogFile(ResultKey resultKey)
Returns the location of the log file for the specified build or deployment.String
getLogFileName(@NotNull Key entityKey, int resultNumber)
Deprecated.since 6.5 usegetLogFileName(Key, long)
String
getLogFileName(@NotNull Key entityKey, long resultNumber)
Returns the standard name of the log file for the specified build or deployment.String
getLogFileName(ResultKey resultKey)
Returns the standard name of the log file for the specified build or deployment.List<String>
getLogsFileNames(@NotNull ResultKey resultKey)
Return all log filenames sorted by age (newest first).List<String>
getOldLogsFileNames(@NotNull ResultKey resultKey)
If a result has logs from previous runs, return their filenames sorted by age (newest first).File
getRootBuildDataDirectory()
Returns the root build data directory for all plans and deployment projects.void
renameOldBuildLogsIfNeeded(@NotNull ResultKey resultKey)
Makes sure that build log file for the current result is empty, by renaming any pre-existing build logs.
-
-
-
Method Detail
-
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.since 6.5 usegetLogFileName(Key, long)
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 usegetLogFile(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 buildFile
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 buildFile
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 alsorenameOldBuildLogsIfNeeded(ResultKey)
- Since:
- 7.2
-
-