Package org.eclipse.jgit.gitrepo
Class RepoProject
- java.lang.Object
-
- org.eclipse.jgit.gitrepo.RepoProject
-
- All Implemented Interfaces:
Comparable<RepoProject>
public class RepoProject extends Object implements Comparable<RepoProject>
The representation of a repo sub project.- Since:
- 4.0
- See Also:
- git-repo project page
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RepoProject.CopyFile
The representation of a copy file configuration.static class
RepoProject.LinkFile
The representation of a link file configuration.static class
RepoProject.ReferenceFile
The representation of a reference file configuration.
-
Constructor Summary
Constructors Constructor Description RepoProject(String name, String path, String revision, String remote, String groupsParam)
Constructor for RepoProjectRepoProject(String name, String path, String revision, String remote, Set<String> groups, String recommendShallow)
Constructor for RepoProject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
clearCopyFiles()
Clear all the copyfiles.void
clearLinkFiles()
Clear all the linkfiles.int
compareTo(RepoProject that)
boolean
equals(Object o)
List<RepoProject.CopyFile>
getCopyFiles()
Getter for the copyfile configurations.Set<String>
getGroups()
Return the set of groups.List<RepoProject.LinkFile>
getLinkFiles()
Getter for the linkfile configurations.String
getName()
Get the name (relative path to theremote
) of this sub repo.String
getPath()
Get the path (relative path to the super project) of this sub repo.String
getRecommendShallow()
Return the recommendation for shallowness.String
getRemote()
Get the name of the remote definition of the sub repo.String
getRevision()
Get the revision of the sub repo.String
getUrl()
Get the url of the sub repo.int
hashCode()
boolean
inGroup(String group)
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.RepoProject
setDefaultRevision(String defaultRevision)
Set the default revision for the sub repo.RepoProject
setGroups(String groupsParam)
Set the url of the sub repo.void
setRecommendShallow(String recommendShallow)
Sets the recommendation for shallowness.RepoProject
setUrl(String url)
Set the url of the sub repo.
-
-
-
Constructor Detail
-
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
public RepoProject(String name, String path, String revision, String remote, String groupsParam)
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 Detail
-
setUrl
public RepoProject setUrl(String url)
Set the url of the sub repo.- Parameters:
url
- project url- Returns:
- this for chaining.
-
setGroups
public RepoProject setGroups(String groupsParam)
Set the url of the sub repo.- Parameters:
groupsParam
- comma separated group list- Returns:
- this for chaining.
- Since:
- 4.4
-
setDefaultRevision
public RepoProject setDefaultRevision(String defaultRevision)
Set the default revision for the sub repo.- Parameters:
defaultRevision
- the name of the default revision- Returns:
- this for chaining.
-
getName
public String getName()
Get the name (relative path to theremote
) of this sub repo.- Returns:
name
-
getPath
public String getPath()
Get the path (relative path to the super project) of this sub repo.- Returns:
path
-
getRevision
public String getRevision()
Get the revision of the sub repo.- Returns:
revision
if set, ordefaultRevision
.
-
getCopyFiles
public List<RepoProject.CopyFile> getCopyFiles()
Getter for the copyfile configurations.- Returns:
- Immutable copy of
copyfiles
-
getLinkFiles
public List<RepoProject.LinkFile> getLinkFiles()
Getter for the linkfile configurations.- Returns:
- Immutable copy of
linkfiles
- Since:
- 4.8
-
getUrl
public String getUrl()
Get the url of the sub repo.- Returns:
url
-
getRemote
public String getRemote()
Get the name of the remote definition of the sub repo.- Returns:
remote
-
inGroup
public boolean inGroup(String group)
Test whether this sub repo belongs to a specified group.- Parameters:
group
- a group- Returns:
- true if
group
is present.
-
getGroups
public Set<String> getGroups()
Return the set of groups.- Returns:
- a Set of groups.
- Since:
- 4.4
-
getRecommendShallow
public String getRecommendShallow()
Return the recommendation for shallowness.- Returns:
- the String of "clone-depth"
- Since:
- 4.4
-
setRecommendShallow
public void setRecommendShallow(String recommendShallow)
Sets the recommendation for shallowness.- Parameters:
recommendShallow
- recommendation for shallowness- Since:
- 4.4
-
addCopyFile
public void addCopyFile(RepoProject.CopyFile copyfile)
Add a copy file configuration.- Parameters:
copyfile
- aRepoProject.CopyFile
object.
-
addCopyFiles
public void addCopyFiles(Collection<RepoProject.CopyFile> copyFiles)
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
public void addLinkFile(RepoProject.LinkFile linkfile)
Add a link file configuration.- Parameters:
linkfile
- aRepoProject.LinkFile
object.- Since:
- 4.8
-
addLinkFiles
public void addLinkFiles(Collection<RepoProject.LinkFile> linkFiles)
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
-
isAncestorOf
public boolean isAncestorOf(RepoProject that)
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
public boolean isAncestorOf(String thatPath)
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
-
compareTo
public int compareTo(RepoProject that)
- Specified by:
compareTo
in interfaceComparable<RepoProject>
-
-