Class StorageLocationServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.storage.location.StorageLocationServiceImpl
-
- All Implemented Interfaces:
StorageLocationService
public class StorageLocationServiceImpl extends Object implements StorageLocationService
-
-
Field Summary
Fields Modifier and Type Field Description static StringBUILD_LOGS_DIRECTORY
-
Constructor Summary
Constructors Constructor Description StorageLocationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactDirectoryBuildergetArtifactDirectoryBuilder(File rootStorageDirectory)Returns an ArtifactDirectoryBuilder which can be used to buildFileobjects pointing to artifacts stored on the local filesystem.ArtifactPathBuildergetArtifactPathBuilder(char separatorChar)Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts.ArtifactPathBuildergetArtifactPathBuilder(String rootStoragePath, char separatorChar)Returns an ArtifactPathBuilder which can be used to construct paths to stored artifacts.FilegetBuildDataDirectory(Key key)Returns the top level build data directory for a plan or deployment project.FilegetBuildDownloadDataDirectory(Key key)Returns the "download data" directory for a plan or deployment project.FilegetBuildLogsDirectory(Key key)Eg. "...FilegetBuildResultsDirectory(Key buildKey)Eg. "...@NotNull ArtifactDirectoryBuildergetDefaultArtifactDirectoryBuilder()This method will only work on the server, not on remote agents.FilegetLogFile(@NotNull ResultKey resultKey, @Nullable String suffix)Returns the location of the log file for the specified build or deployment.FilegetLogFile(Key entityKey, int resultNumber)Returns the location of the log file for the specified build or deployment.FilegetLogFile(Key entityKey, long resultNumber)Returns the location of the log file for the specified build or deployment.FilegetLogFile(ResultKey resultKey)Returns the location of the log file for the specified build or deployment.StringgetLogFileName(@NotNull Key entityKey, int resultNumber)Returns the standard name of the log file for the specified build or deployment.StringgetLogFileName(@NotNull Key entityKey, long resultNumber)Returns the standard name of the log file for the specified build or deployment.StringgetLogFileName(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).FilegetRootBuildDataDirectory()Returns the root build data directory for all plans and deployment projects.voidrenameOldBuildLogsIfNeeded(@NotNull ResultKey resultKey)Makes sure that build log file for the current result is empty, by renaming any pre-existing build logs.
-
-
-
Field Detail
-
BUILD_LOGS_DIRECTORY
public static final String BUILD_LOGS_DIRECTORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRootBuildDataDirectory
public File getRootBuildDataDirectory()
Description copied from interface:StorageLocationServiceReturns the root build data directory for all plans and deployment projects.- Specified by:
getRootBuildDataDirectoryin interfaceStorageLocationService
-
getBuildDataDirectory
public File getBuildDataDirectory(Key key)
Description copied from interface:StorageLocationServiceReturns 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/"- Specified by:
getBuildDataDirectoryin interfaceStorageLocationService
-
getBuildResultsDirectory
public File getBuildResultsDirectory(Key buildKey)
Description copied from interface:StorageLocationServiceEg. ".../xml-data/builds/plan-12345-JOB1/results/"- Specified by:
getBuildResultsDirectoryin interfaceStorageLocationService
-
getBuildDownloadDataDirectory
public File getBuildDownloadDataDirectory(Key key)
Description copied from interface:StorageLocationServiceReturns the "download data" directory for a plan or deployment project. Eg. ".../xml-data/builds/plan-12345-JOB1/download-data/"- Specified by:
getBuildDownloadDataDirectoryin interfaceStorageLocationService
-
getBuildLogsDirectory
public File getBuildLogsDirectory(Key key)
Description copied from interface:StorageLocationServiceEg. ".../xml-data/builds/plan-12345-JOB1/download-data/build_logs/"- Specified by:
getBuildLogsDirectoryin interfaceStorageLocationService
-
getLogFileName
public String getLogFileName(@NotNull @NotNull Key entityKey, int resultNumber)
Description copied from interface:StorageLocationServiceReturns the standard name of the log file for the specified build or deployment.- Specified by:
getLogFileNamein interfaceStorageLocationService
-
getLogFileName
public String getLogFileName(@NotNull @NotNull Key entityKey, long resultNumber)
Description copied from interface:StorageLocationServiceReturns the standard name of the log file for the specified build or deployment.- Specified by:
getLogFileNamein interfaceStorageLocationService
-
getLogFileName
public String getLogFileName(ResultKey resultKey)
Description copied from interface:StorageLocationServiceReturns the standard name of the log file for the specified build or deployment.- Specified by:
getLogFileNamein interfaceStorageLocationService
-
getLogFile
public File getLogFile(Key entityKey, int resultNumber)
Description copied from interface:StorageLocationServiceReturns the location of the log file for the specified build or deployment.- Specified by:
getLogFilein interfaceStorageLocationService
-
getLogFile
public File getLogFile(Key entityKey, long resultNumber)
Description copied from interface:StorageLocationServiceReturns the location of the log file for the specified build or deployment.- Specified by:
getLogFilein interfaceStorageLocationService
-
getLogFile
public File getLogFile(ResultKey resultKey)
Description copied from interface:StorageLocationServiceReturns the location of the log file for the specified build or deployment.- Specified by:
getLogFilein interfaceStorageLocationService
-
getLogFile
public File getLogFile(@NotNull @NotNull ResultKey resultKey, @Nullable @Nullable String suffix)
Description copied from interface:StorageLocationServiceReturns the location of the log file for the specified build or deployment. Optional suffix parameter allows getting logs from previous runs.- Specified by:
getLogFilein interfaceStorageLocationService
-
renameOldBuildLogsIfNeeded
public void renameOldBuildLogsIfNeeded(@NotNull @NotNull ResultKey resultKey)Description copied from interface:StorageLocationServiceMakes sure that build log file for the current result is empty, by renaming any pre-existing build logs.- Specified by:
renameOldBuildLogsIfNeededin interfaceStorageLocationService
-
getOldLogsFileNames
public List<String> getOldLogsFileNames(@NotNull @NotNull ResultKey resultKey)
Description copied from interface:StorageLocationServiceIf a result has logs from previous runs, return their filenames sorted by age (newest first). See alsoStorageLocationService.renameOldBuildLogsIfNeeded(ResultKey)- Specified by:
getOldLogsFileNamesin interfaceStorageLocationService
-
getLogsFileNames
public List<String> getLogsFileNames(@NotNull @NotNull ResultKey resultKey)
Description copied from interface:StorageLocationServiceReturn all log filenames sorted by age (newest first).- Specified by:
getLogsFileNamesin interfaceStorageLocationService
-
getDefaultArtifactDirectoryBuilder
@NotNull public @NotNull ArtifactDirectoryBuilder getDefaultArtifactDirectoryBuilder()
This method will only work on the server, not on remote agents.- Specified by:
getDefaultArtifactDirectoryBuilderin interfaceStorageLocationService
-
getArtifactPathBuilder
public ArtifactPathBuilder getArtifactPathBuilder(String rootStoragePath, char separatorChar)
Description copied from interface:StorageLocationServiceReturns 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.- Specified by:
getArtifactPathBuilderin interfaceStorageLocationService
-
getArtifactPathBuilder
public ArtifactPathBuilder getArtifactPathBuilder(char separatorChar)
Description copied from interface:StorageLocationServiceReturns 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.- Specified by:
getArtifactPathBuilderin interfaceStorageLocationService
-
getArtifactDirectoryBuilder
public ArtifactDirectoryBuilder getArtifactDirectoryBuilder(File rootStorageDirectory)
Description copied from interface:StorageLocationServiceReturns an ArtifactDirectoryBuilder which can be used to buildFileobjects pointing to artifacts stored on the local filesystem. This version of the method takes a rootArtifactDirectory parameter.- Specified by:
getArtifactDirectoryBuilderin interfaceStorageLocationService
-
-