Package org.eclipse.jgit.gitrepo
Class RepoProject
java.lang.Object
org.eclipse.jgit.gitrepo.RepoProject
- All Implemented Interfaces:
Comparable<RepoProject>
The representation of a repo sub project.
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The representation of a copy file configuration.static class
The representation of a link file configuration.static class
The representation of a reference file configuration. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCopyFile
(RepoProject.CopyFile copyfile) Add a copy file configuration.void
addCopyFiles
(Collection<RepoProject.CopyFile> copyFiles) Add a bunch of copyfile configurations.void
addLinkFile
(RepoProject.LinkFile linkfile) Add a link file configuration.void
addLinkFiles
(Collection<RepoProject.LinkFile> linkFiles) Add a bunch of linkfile configurations.void
Clear all the copyfiles.void
Clear all the linkfiles.int
compareTo
(RepoProject that) boolean
Getter for the copyfile configurations.Return the set of groups.Getter for the linkfile configurations.getName()
Get the name (relative path to theremote
) of this sub repo.getPath()
Get the path (relative path to the super project) of this sub repo.private String
Return the recommendation for shallowness.Get the name of the remote definition of the sub repo.Get the revision of the sub repo.getUrl()
Get the url of the sub repo.int
hashCode()
boolean
Test whether this sub repo belongs to a specified group.boolean
isAncestorOf
(String thatPath) Check if this sub repo is an ancestor of the given path.boolean
isAncestorOf
(RepoProject that) Check if this sub repo is the ancestor of given sub repo.setDefaultRevision
(String defaultRevision) Set the default revision for the sub repo.Set the url of the sub repo.void
setRecommendShallow
(String recommendShallow) Sets the recommendation for shallowness.Set the url of the sub repo.
-
Field Details
-
name
-
path
-
revision
-
remote
-
groups
-
copyfiles
-
linkfiles
-
recommendShallow
-
url
-
defaultRevision
-
-
Constructor Details
-
RepoProject
public RepoProject(String name, String path, String revision, String remote, Set<String> groups, String recommendShallow) Constructor for RepoProject- Parameters:
name
- the relative path to theremote
path
- the relative path to the super projectrevision
- a SHA-1 or branch name or tag nameremote
- name of the remote definitiongroups
- set of groupsrecommendShallow
- recommendation for shallowness- Since:
- 4.4
-
RepoProject
Constructor for RepoProject- Parameters:
name
- the relative path to theremote
path
- the relative path to the super projectrevision
- a SHA-1 or branch name or tag nameremote
- name of the remote definitiongroupsParam
- comma separated group list
-
-
Method Details
-
setUrl
Set the url of the sub repo.- Parameters:
url
- project url- Returns:
- this for chaining.
-
setGroups
Set the url of the sub repo.- Parameters:
groupsParam
- comma separated group list- Returns:
- this for chaining.
- Since:
- 4.4
-
setDefaultRevision
Set the default revision for the sub repo.- Parameters:
defaultRevision
- the name of the default revision- Returns:
- this for chaining.
-
getName
Get the name (relative path to theremote
) of this sub repo.- Returns:
name
-
getPath
Get the path (relative path to the super project) of this sub repo.- Returns:
path
-
getRevision
Get the revision of the sub repo.- Returns:
revision
if set, ordefaultRevision
.
-
getCopyFiles
Getter for the copyfile configurations.- Returns:
- Immutable copy of
copyfiles
-
getLinkFiles
Getter for the linkfile configurations.- Returns:
- Immutable copy of
linkfiles
- Since:
- 4.8
-
getUrl
Get the url of the sub repo.- Returns:
url
-
getRemote
Get the name of the remote definition of the sub repo.- Returns:
remote
-
inGroup
Test whether this sub repo belongs to a specified group.- Parameters:
group
- a group- Returns:
- true if
group
is present.
-
getGroups
Return the set of groups.- Returns:
- a Set of groups.
- Since:
- 4.4
-
getRecommendShallow
Return the recommendation for shallowness.- Returns:
- the String of "clone-depth"
- Since:
- 4.4
-
setRecommendShallow
Sets the recommendation for shallowness.- Parameters:
recommendShallow
- recommendation for shallowness- Since:
- 4.4
-
addCopyFile
Add a copy file configuration.- Parameters:
copyfile
- aRepoProject.CopyFile
object.
-
addCopyFiles
Add a bunch of copyfile configurations.- Parameters:
copyFiles
- a collection ofRepoProject.CopyFile
objects
-
clearCopyFiles
public void clearCopyFiles()Clear all the copyfiles.- Since:
- 4.2
-
addLinkFile
Add a link file configuration.- Parameters:
linkfile
- aRepoProject.LinkFile
object.- Since:
- 4.8
-
addLinkFiles
Add a bunch of linkfile configurations.- Parameters:
linkFiles
- a collection ofRepoProject.LinkFile
s- Since:
- 4.8
-
clearLinkFiles
public void clearLinkFiles()Clear all the linkfiles.- Since:
- 4.8
-
getPathWithSlash
-
isAncestorOf
Check if this sub repo is the ancestor of given sub repo.- Parameters:
that
- non null- Returns:
- true if this sub repo is the ancestor of given sub repo.
-
isAncestorOf
Check if this sub repo is an ancestor of the given path.- Parameters:
thatPath
- path to be checked to see if it is within this repository- Returns:
- true if this sub repo is an ancestor of the given path.
- Since:
- 4.2
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<RepoProject>
-