Class VcsWorkspaceAccessImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.VcsWorkspaceAccessImpl
-
- All Implemented Interfaces:
VcsWorkspaceAccess
public class VcsWorkspaceAccessImpl extends Object implements VcsWorkspaceAccess
- Author:
- dmitry.neverov
-
-
Constructor Summary
Constructors Constructor Description VcsWorkspaceAccessImpl(List<VcsRootInstanceEntry> entries, VcsManagerEx vcsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canListFiles()
byte[]
getFileContent(String relativePath)
Get binary content of the file corresponding to the latest revision detected during the checking for changes process.byte[]
getFileContent(String relativePath, boolean latest)
Same as {@link #getFileContent(String, false)}VcsBrowser
getVcsFilesBrowser()
Browser
getVcsFoldersBrowser()
List<VcsFile>
listFiles(String relativePath)
Lists files in the directory specified by relativePathPathMapping
mapVcsPath(String path)
Returns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots.
-
-
-
Constructor Detail
-
VcsWorkspaceAccessImpl
public VcsWorkspaceAccessImpl(@NotNull List<VcsRootInstanceEntry> entries, @NotNull VcsManagerEx vcsManager)
-
-
Method Detail
-
getFileContent
@NotNull public byte[] getFileContent(@NotNull String relativePath) throws VcsException
Description copied from interface:VcsWorkspaceAccess
Get binary content of the file corresponding to the latest revision detected during the checking for changes process.- Specified by:
getFileContent
in interfaceVcsWorkspaceAccess
- Parameters:
relativePath
- relative file path regarding to the project root, "checkout root" from vcs root should not be included- Returns:
- binary content of the file
- Throws:
VcsException
- if some problem occurred while getting file content from the source control repository.
-
getFileContent
@NotNull public byte[] getFileContent(@NotNull String relativePath, boolean latest) throws VcsException
Description copied from interface:VcsWorkspaceAccess
Same as {@link #getFileContent(String, false)}- Specified by:
getFileContent
in interfaceVcsWorkspaceAccess
- Parameters:
relativePath
- relative file path regarding to the project root, "checkout root" from vcs root should not be includedlatest
- if false, then file content corresponds to the revision detected during the last checking for changes process, if true, then the file content for the current repository revision will be returned- Returns:
- binary content of the file
- Throws:
VcsException
- if some problem occurred while getting file content from the source control repository.
-
mapVcsPath
public PathMapping mapVcsPath(@NotNull String path)
Description copied from interface:VcsWorkspaceAccess
Returns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots. Full path is from the root of build type, e.g. for VCS root with checkout rules +:.=>subdir, file f in the this root has a full path subdir/f.- Specified by:
mapVcsPath
in interfaceVcsWorkspaceAccess
- Parameters:
path
- a full path to a file (not necessarily existing)- Returns:
- the path mapping object or null if no mapping exists
-
canListFiles
public boolean canListFiles()
- Specified by:
canListFiles
in interfaceVcsWorkspaceAccess
- Returns:
- true if list files is possible, false otherwise
-
listFiles
@NotNull public List<VcsFile> listFiles(@NotNull String relativePath) throws VcsException
Description copied from interface:VcsWorkspaceAccess
Lists files in the directory specified by relativePath- Specified by:
listFiles
in interfaceVcsWorkspaceAccess
- Parameters:
relativePath
- relative path regarding to the project root, "checkout root" from vcs root should not be included- Returns:
- list of files in directory
- Throws:
VcsException
- if some problem occurred while listing files or when files cannot be listed (canListFiles() returns false)
-
getVcsFilesBrowser
@NotNull public VcsBrowser getVcsFilesBrowser()
- Specified by:
getVcsFilesBrowser
in interfaceVcsWorkspaceAccess
- Returns:
- tree browser that shouws all contents VCS
-
getVcsFoldersBrowser
@NotNull public Browser getVcsFoldersBrowser()
- Specified by:
getVcsFoldersBrowser
in interfaceVcsWorkspaceAccess
- Returns:
- tree browser that shouws only directories in VCS
-
-