Top Description Inners Fields Constructors Methods
org.eclipse.jgit.gitrepo

public Class RepoProject

extends Object
implements Comparable<RepoProject>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
Imports
java.io.File, .FileInputStream, .FileOutputStream, .IOException, java.nio.channels.FileChannel, java.util.ArrayList, .Arrays, .Collection, .Collections, .HashSet, .List, .Set, org.eclipse.jgit.lib.Repository

The representation of a repo sub project.
Since
4.0
See Also
git-repo project page

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
RepoProject.CopyFile

The representation of a copy file configuration.

public static class
RepoProject.LinkFile

The representation of a link file configuration.

public static class
RepoProject.ReferenceFile

The representation of a reference file configuration.

Field Summary

Modifier and TypeField and Description
private final List<RepoProject.CopyFile>
private String
private String
private final Set<String>
private final List<RepoProject.LinkFile>
private final String
private final String
private String
private final String
private final String
private String
private String

Constructor Summary

AccessConstructor and Description
public
RepoProject(String
the relative path to the remote
name
,
String
the relative path to the super project
path
,
String
a SHA-1 or branch name or tag name
revision
,
String
name of the remote definition
remote
,
Set<String>
set of groups
groups
,
String
recommendation for shallowness
recommendShallow
)

Constructor for RepoProject

public
RepoProject(String
the relative path to the remote
name
,
String
the relative path to the super project
path
,
String
a SHA-1 or branch name or tag name
revision
,
String
name of the remote definition
remote
,
String
comma separated group list
groupsParam
)

Constructor for RepoProject

Method Summary

Modifier and TypeMethod and Description
public void
addCopyFile(RepoProject.CopyFile copyfile)

Add a copy file configuration.

public void
addCopyFiles(Collection<RepoProject.CopyFile> copyFiles)

Add a bunch of copyfile configurations.

public void
addLinkFile(RepoProject.LinkFile linkfile)

Add a link file configuration.

public void
addLinkFiles(Collection<RepoProject.LinkFile>
a collection of LinkFiles
linkFiles
)

Add a bunch of linkfile configurations.

public void
clearCopyFiles()

Clear all the copyfiles.

public void
clearLinkFiles()

Clear all the linkfiles.

public int
compareTo(RepoProject
the object to be compared.
that
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public List<RepoProject.CopyFile>

Returns:

Immutable copy of copyfiles
getCopyFiles
()

Getter for the copyfile configurations.

public String

Returns:

the dest-branch value if present, null otherwise.
getDestBranch
()

Return the dest-branch attribute of the project

public Set<String>

Returns:

a Set of groups.
getGroups
()

Return the set of groups.

public List<RepoProject.LinkFile>

Returns:

Immutable copy of linkfiles
getLinkFiles
()

Getter for the linkfile configurations.

public String

Returns:

name
getName
()

Get the name (relative path to the remote) of this sub repo.

public String

Returns:

path
getPath
()

Get the path (relative path to the super project) of this sub repo.

private String
public String

Returns:

the String of "clone-depth"
getRecommendShallow
()

Return the recommendation for shallowness.

public String

Returns:

remote
getRemote
()

Get the name of the remote definition of the sub repo.

public String

Returns:

revision if set, or defaultRevision.
getRevision
()

Get the revision of the sub repo.

public String

Returns:

the upstream value if present, null otherwise.
getUpstream
()

Return the upstream attribute of the project

public String

Returns:

url
getUrl
()

Get the url of the sub repo.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean

Returns:

true if group is present.
inGroup
(String
a group
group
)

Test whether this sub repo belongs to a specified group.

public boolean

Returns:

true if this sub repo is the ancestor of given sub repo.
isAncestorOf
(RepoProject
non null
that
)

Check if this sub repo is the ancestor of given sub repo.

public boolean

Returns:

true if this sub repo is an ancestor of the given path.
isAncestorOf
(String
path to be checked to see if it is within this repository
thatPath
)

Check if this sub repo is an ancestor of the given path.

public RepoProject

Returns:

this for chaining.
setDefaultRevision
(String
the name of the default revision
defaultRevision
)

Set the default revision for the sub repo.

public void
setDestBranch(String
value of the attribute in the manifest
destBranch
)

Set the dest-branch attribute of the project Name of a Git branch.

public RepoProject

Returns:

this for chaining.
setGroups
(String
comma separated group list
groupsParam
)

Set the url of the sub repo.

public void
setRecommendShallow(String
recommendation for shallowness
recommendShallow
)

Sets the recommendation for shallowness.

public void
setUpstream(String
value of the attribute in the manifest
upstream
)

Set the upstream attribute of the project Name of the git ref in which a sha1 can be found, when the revision is a sha1.

public RepoProject

Returns:

this for chaining.
setUrl
(String
project url
url
)

Set the url of the sub repo.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

copyfilesback to summary
private final List<RepoProject.CopyFile> copyfiles
defaultRevisionback to summary
private String defaultRevision
destBranchback to summary
private String destBranch
groupsback to summary
private final Set<String> groups
linkfilesback to summary
private final List<RepoProject.LinkFile> linkfiles
nameback to summary
private final String name
pathback to summary
private final String path
recommendShallowback to summary
private String recommendShallow
remoteback to summary
private final String remote
revisionback to summary
private final String revision
upstreamback to summary
private String upstream
urlback to summary
private String url

Constructor Detail

RepoProjectback to summary
public RepoProject(String name, String path, String revision, String remote, Set<String> groups, String recommendShallow)

Constructor for RepoProject

Parameters
name:String

the relative path to the remote

path:String

the relative path to the super project

revision:String

a SHA-1 or branch name or tag name

remote:String

name of the remote definition

groups:Set<String>

set of groups

recommendShallow:String

recommendation for shallowness

Since
4.4
RepoProjectback to summary
public RepoProject(String name, String path, String revision, String remote, String groupsParam)

Constructor for RepoProject

Parameters
name:String

the relative path to the remote

path:String

the relative path to the super project

revision:String

a SHA-1 or branch name or tag name

remote:String

name of the remote definition

groupsParam:String

comma separated group list

Method Detail

addCopyFileback to summary
public void addCopyFile(RepoProject.CopyFile copyfile)

Add a copy file configuration.

Parameters
copyfile:RepoProject.CopyFile

a org.eclipse.jgit.gitrepo.RepoProject.CopyFile object.

addCopyFilesback to summary
public void addCopyFiles(Collection<RepoProject.CopyFile> copyFiles)

Add a bunch of copyfile configurations.

Parameters
copyFiles:Collection<RepoProject.CopyFile>

a collection of org.eclipse.jgit.gitrepo.RepoProject.CopyFile objects

addLinkFileback to summary
public void addLinkFile(RepoProject.LinkFile linkfile)

Add a link file configuration.

Parameters
linkfile:RepoProject.LinkFile

a org.eclipse.jgit.gitrepo.RepoProject.LinkFile object.

Since
4.8
addLinkFilesback to summary
public void addLinkFiles(Collection<RepoProject.LinkFile> linkFiles)

Add a bunch of linkfile configurations.

Parameters
linkFiles:Collection<RepoProject.LinkFile>

a collection of LinkFiles

Since
4.8
clearCopyFilesback to summary
public void clearCopyFiles()

Clear all the copyfiles.

Since
4.2
clearLinkFilesback to summary
public void clearLinkFiles()

Clear all the linkfiles.

Since
4.8
compareToback to summary
public int compareTo(RepoProject that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
that:RepoProject

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCopyFilesback to summary
public List<RepoProject.CopyFile> getCopyFiles()

Getter for the copyfile configurations.

Returns:List<RepoProject.CopyFile>

Immutable copy of copyfiles

getDestBranchback to summary
public String getDestBranch()

Return the dest-branch attribute of the project

Returns:String

the dest-branch value if present, null otherwise.

Since
6.10
getGroupsback to summary
public Set<String> getGroups()

Return the set of groups.

Returns:Set<String>

a Set of groups.

Since
4.4
getLinkFilesback to summary
public List<RepoProject.LinkFile> getLinkFiles()

Getter for the linkfile configurations.

Returns:List<RepoProject.LinkFile>

Immutable copy of linkfiles

Since
4.8
getNameback to summary
public String getName()

Get the name (relative path to the remote) of this sub repo.

Returns:String

name

getPathback to summary
public String getPath()

Get the path (relative path to the super project) of this sub repo.

Returns:String

path

getPathWithSlashback to summary
private String getPathWithSlash()
getRecommendShallowback to summary
public String getRecommendShallow()

Return the recommendation for shallowness.

Returns:String

the String of "clone-depth"

Since
4.4
getRemoteback to summary
public String getRemote()

Get the name of the remote definition of the sub repo.

Returns:String

remote

getRevisionback to summary
public String getRevision()

Get the revision of the sub repo.

Returns:String

revision if set, or defaultRevision.

getUpstreamback to summary
public String getUpstream()

Return the upstream attribute of the project

Returns:String

the upstream value if present, null otherwise.

Since
6.10
getUrlback to summary
public String getUrl()

Get the url of the sub repo.

Returns:String

url

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
inGroupback to summary
public boolean inGroup(String group)

Test whether this sub repo belongs to a specified group.

Parameters
group:String

a group

Returns:boolean

true if group is present.

isAncestorOfback to summary
public boolean isAncestorOf(RepoProject that)

Check if this sub repo is the ancestor of given sub repo.

Parameters
that:RepoProject

non null

Returns:boolean

true if this sub repo is the ancestor of given sub repo.

isAncestorOfback to summary
public boolean isAncestorOf(String thatPath)

Check if this sub repo is an ancestor of the given path.

Parameters
thatPath:String

path to be checked to see if it is within this repository

Returns:boolean

true if this sub repo is an ancestor of the given path.

Since
4.2
setDefaultRevisionback to summary
public RepoProject setDefaultRevision(String defaultRevision)

Set the default revision for the sub repo.

Parameters
defaultRevision:String

the name of the default revision

Returns:RepoProject

this for chaining.

setDestBranchback to summary
public void setDestBranch(String destBranch)

Set the dest-branch attribute of the project Name of a Git branch.

Parameters
destBranch:String

value of the attribute in the manifest

Since
6.10
setGroupsback to summary
public RepoProject setGroups(String groupsParam)

Set the url of the sub repo.

Parameters
groupsParam:String

comma separated group list

Returns:RepoProject

this for chaining.

Since
4.4
setRecommendShallowback to summary
public void setRecommendShallow(String recommendShallow)

Sets the recommendation for shallowness.

Parameters
recommendShallow:String

recommendation for shallowness

Since
4.4
setUpstreamback to summary
public void setUpstream(String upstream)

Set the upstream attribute of the project Name of the git ref in which a sha1 can be found, when the revision is a sha1.

Parameters
upstream:String

value of the attribute in the manifest

Since
6.10
setUrlback to summary
public RepoProject setUrl(String url)

Set the url of the sub repo.

Parameters
url:String

project url

Returns:RepoProject

this for chaining.

org.eclipse.jgit.gitrepo back to summary

public Class RepoProject.CopyFile

extends ReferenceFile
Class Inheritance

The representation of a copy file configuration.

Field Summary

Inherited from org.eclipse.jgit.gitrepo.RepoProject.ReferenceFile:
destpathreposrc

Constructor Summary

AccessConstructor and Description
public
CopyFile(Repository
the super project.
repo
,
String
the path of the project containing this copyfile config.
path
,
String
the source path relative to the sub repo.
src
,
String
the destination path relative to the super project.
dest
)

Method Summary

Modifier and TypeMethod and Description
public void
copy()

Do the copy file action.

Constructor Detail

CopyFileback to summary
public CopyFile(Repository repo, String path, String src, String dest)
Parameters
repo:Repository

the super project.

path:String

the path of the project containing this copyfile config.

src:String

the source path relative to the sub repo.

dest:String

the destination path relative to the super project.

Method Detail

copyback to summary
public void copy() throws IOException

Do the copy file action.

Exceptions
IOException:
if an IO error occurred
org.eclipse.jgit.gitrepo back to summary

public Class RepoProject.LinkFile

extends ReferenceFile
Class Inheritance

The representation of a link file configuration.
Since
4.8

Field Summary

Inherited from org.eclipse.jgit.gitrepo.RepoProject.ReferenceFile:
destpathreposrc

Constructor Summary

AccessConstructor and Description
public
LinkFile(Repository
the super project.
repo
,
String
the path of the project containing this linkfile config.
path
,
String
the source path relative to the sub repo.
src
,
String
the destination path relative to the super project.
dest
)

Constructor Detail

LinkFileback to summary
public LinkFile(Repository repo, String path, String src, String dest)
Parameters
repo:Repository

the super project.

path:String

the path of the project containing this linkfile config.

src:String

the source path relative to the sub repo.

dest:String

the destination path relative to the super project.

org.eclipse.jgit.gitrepo back to summary

public Class RepoProject.ReferenceFile

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.gitrepo.RepoProject.CopyFile, org.eclipse.jgit.gitrepo.RepoProject.LinkFile

The representation of a reference file configuration.
Since
4.8

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final String
pack-priv final Repository
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
ReferenceFile(Repository
the super project.
repo
,
String
the path of the project containing this copyfile config.
path
,
String
the source path relative to the sub repo.
src
,
String
the destination path relative to the super project.
dest
)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

destback to summary
pack-priv final String dest
pathback to summary
pack-priv final String path
repoback to summary
pack-priv final Repository repo
srcback to summary
pack-priv final String src

Constructor Detail

ReferenceFileback to summary
public ReferenceFile(Repository repo, String path, String src, String dest)
Parameters
repo:Repository

the super project.

path:String

the path of the project containing this copyfile config.

src:String

the source path relative to the sub repo.

dest:String

the destination path relative to the super project.