Package sonia.scm.repository.api
Class CatCommandBuilder
java.lang.Object
sonia.scm.repository.api.CatCommandBuilder
Shows the content of a file in the
Sample:
Print the content of the file core/pom.xml from revision 46a23689ac91:
Repository
.Sample:
Print the content of the file core/pom.xml from revision 46a23689ac91:
CatCommandBuilder cat = repositoryService.getCatCommand();
String content = cat.setRevision("46a23689ac91").getContent("core/pom.xml");
System.out.println(content);
- Since:
- 1.17
-
Method Summary
Modifier and TypeMethodDescriptiongetContent
(String path) Returns the content of the given file.Returns an output stream with the file content.reset()
Reset each parameter to its default value.void
retriveContent
(OutputStream outputStream, String path) Passes the content of the given file to the output stream.setRevision
(String revision) Sets the revision of the file.
-
Method Details
-
reset
Reset each parameter to its default value.- Returns:
this
-
retriveContent
Passes the content of the given file to the output stream.- Parameters:
outputStream
- output stream for the contentpath
- file path- Throws:
IOException
-
getStream
Returns an output stream with the file content.- Parameters:
path
- file path- Throws:
IOException
-
getContent
Returns the content of the given file.- Throws:
IOException
-
setRevision
Sets the revision of the file.- Returns:
this
-