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 booleancanListFiles()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)}VcsBrowsergetVcsFilesBrowser()BrowsergetVcsFoldersBrowser()List<VcsFile>listFiles(String relativePath)Lists files in the directory specified by relativePathPathMappingmapVcsPath(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 VcsExceptionDescription copied from interface:VcsWorkspaceAccessGet binary content of the file corresponding to the latest revision detected during the checking for changes process.- Specified by:
getFileContentin 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 VcsExceptionDescription copied from interface:VcsWorkspaceAccessSame as {@link #getFileContent(String, false)}- Specified by:
getFileContentin 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:VcsWorkspaceAccessReturns 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:
mapVcsPathin 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:
canListFilesin 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:VcsWorkspaceAccessLists files in the directory specified by relativePath- Specified by:
listFilesin 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:
getVcsFilesBrowserin interfaceVcsWorkspaceAccess- Returns:
- tree browser that shouws all contents VCS
-
getVcsFoldersBrowser
@NotNull public Browser getVcsFoldersBrowser()
- Specified by:
getVcsFoldersBrowserin interfaceVcsWorkspaceAccess- Returns:
- tree browser that shouws only directories in VCS
-
-