public abstract class SourceControlManagement extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SourceControlManagement.ExecutionResult
Represents the result of an external command execution.
|
static class |
SourceControlManagement.Status
The source control status of a resource.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
executable |
protected File |
rootFolder |
| Modifier | Constructor and Description |
|---|---|
protected |
SourceControlManagement(String executable) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(File file)
Adds the specified file to be included into the next commit.
|
abstract void |
add(List<File> files)
Adds the specified files to be included into the next commit.
|
boolean |
checkCommit()
Check if a commit is required
|
protected void |
checkExecutionResult(SourceControlManagement.ExecutionResult result) |
abstract boolean |
commit(String message)
Performs a commit into the SCM.
|
protected abstract Map<String,SourceControlManagement.Status> |
createStatusMap() |
protected SourceControlManagement.ExecutionResult |
executeCommand(String command,
String[] arguments) |
abstract Map<String,String> |
getBranchInfos(String uri)
List all available branches on distant repository
|
protected abstract void |
getFromSCM(File workingDirectory,
String uri,
String branchOrTag) |
File |
getRootFolder()
Returns the root folder of the module.
|
SourceControlManagement.Status |
getStatus(String path)
Returns the SCM status of the specified resource.
|
protected Map<String,SourceControlManagement.Status> |
getStatusMap() |
abstract Map<String,String> |
getTagInfos(String uri)
List all available tags on distant repository
|
abstract String |
getURI()
Returns an SCM URI.
|
protected abstract void |
initWithWorkingDirectory(File workingDirectory) |
void |
invalidateStatusCache()
Invalidates the SCM status cache and forces for the next check the SCM interaction.
|
abstract void |
markConflictAsResolved(File file)
Mark SCM conflict as resolved for the specified resource.
|
abstract void |
move(File src,
File dst)
Moves the specified resource to a new location.
|
protected static List<String> |
readLines(String source) |
abstract void |
remove(File file)
Deletes the specified item from the working copy or repository.
|
protected abstract void |
sendToSCM(File workingDirectory,
String url) |
abstract String |
update()
Performs SCM update.
|
protected SourceControlManagement(String executable)
protected static List<String> readLines(String source) throws IOException
IOExceptionpublic final void add(File file) throws IOException
file - a file to be considered as modifiedIOException - in case of an SCM related errorpublic abstract void add(List<File> files) throws IOException
files - the list of files to be considered as modifiedIOException - in case of an SCM related errorprotected void checkExecutionResult(SourceControlManagement.ExecutionResult result) throws IOException
IOExceptionpublic boolean checkCommit()
throws IOException
IOException - if merge conflict is still therepublic abstract boolean commit(String message) throws IOException
message - the commit messagetrue if the commit was effectively executed; false otherwiseIOException - in case of a commit process errorprotected abstract Map<String,SourceControlManagement.Status> createStatusMap() throws IOException
IOExceptionprotected SourceControlManagement.ExecutionResult executeCommand(String command, String[] arguments) throws IOException
IOExceptionpublic File getRootFolder()
public SourceControlManagement.Status getStatus(String path) throws IOException
path - the resource to check the SCM status forIOException - in case of SCM errorsprotected final Map<String,SourceControlManagement.Status> getStatusMap() throws IOException
IOExceptionpublic abstract String getURI() throws IOException
IOException - in case of an SCM related errorprotected abstract void getFromSCM(File workingDirectory, String uri, String branchOrTag) throws IOException
IOExceptionprotected abstract void sendToSCM(File workingDirectory, String url) throws IOException
IOExceptionprotected abstract void initWithWorkingDirectory(File workingDirectory) throws IOException
IOExceptionpublic void invalidateStatusCache()
public abstract void markConflictAsResolved(File file) throws IOException
file - the resource to make as resolvedIOException - in case of SCM errorspublic abstract void move(File src, File dst) throws IOException
src - the sourcedst - the destinationIOException - in case of SCM errorspublic abstract void remove(File file) throws IOException
file - the resource to be removedIOException - in case of SCM errorspublic abstract String update() throws IOException
IOException - in case of SCM errorspublic abstract Map<String,String> getTagInfos(String uri) throws IOException
uri - the remote SCM repository URI (of the trunk for SVN)IOException - in case of tag info retrieval errorspublic abstract Map<String,String> getBranchInfos(String uri) throws IOException
uri - the remote SCM repository URI (of the trunk for SVN)IOException - in case of branch info retrieval errorsCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.