Class LastModifiedRequest
path
, from a given starting commit
. The result
should be similar to retrieving the latest commit
for each
file, but may be significantly more efficient since it can be done in a single request.- Since:
- 4.6
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.atlassian.bitbucket.commit.AbstractCommitRequest
AbstractCommitRequest.AbstractCommitRequestBuilder<B extends AbstractCommitRequest.AbstractCommitRequestBuilder<B>>
-
Field Summary
Fields inherited from class com.atlassian.bitbucket.commit.AbstractCommitRequest
UNLIMITED_MESSAGE_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the starting commit to use.getPath()
Retrieves the path where file modifications should be searched.Methods inherited from class com.atlassian.bitbucket.commit.AbstractCommitRequest
getMaxMessageLength, getRepository
-
Method Details
-
getCommitId
Retrieves the starting commit to use. This ID serves two purposes:- The
path
's file listing will use this commit - The process of searching for modifications will only consider ancestors of this commit
Branch
orTag
. Depending on which files that commit directly modified, however, it's entirely possible none of the resulting last modified commits will be this one.- Overrides:
getCommitId
in classAbstractCommitRequest
- Returns:
- the commit to serve as the starting point when searching for modifications
- The
-
getPath
Retrieves the path where file modifications should be searched. Commits which modify files directly below this path will be traversed to determine the most recent commit to modify each file.null
,""
and/
all indicate the root directory.For example, consider a repository with the following contents. Entries ending with
/
are directories.src/ main/ java/ Example.java resources/ atlassian-plugin.xml pom.xml
A request for the root directory will return the commit that last modifiedpom.xml
, the only file in the root directory. A request forsrc/main
will not return any modifications because that path only contains subdirectories.For performance reasons, there is no way to use this request to recursively find the last modification for files in subdirectories. Each level must be requested individually. This aligns with how
streaming directories
works when therecursive
flag isfalse
.- Overrides:
getPath
in classAbstractCommitRequest
- Returns:
- the path whose file modifications should be searched, or
null
to search for file modifications in the root directory
-