jetbrains.buildServer.vcs.patches
Interface PatchBuilder

All Superinterfaces:
PatchBuilderBase
All Known Implementing Classes:
AbstractPatchBuilder, PatchBuilderAdapter, PatchBuilderFileNamesCorrector

public interface PatchBuilder
extends PatchBuilderBase

This interface allows you to create information about files changed between two version.


Method Summary
 void changeOrCreateBinaryFile(java.io.File file, java.lang.String fileMode, java.io.InputStream input, long length)
          Invoke this method if some binary file content has been changed or binary file has been created in the next version as compared with the previous one.
 void changeOrCreateTextFile(java.io.File localFile, java.lang.String fileMode, java.io.InputStream input, long length, byte[] lineSeparator)
          Invoke this method if some text file content has been changed or text file has been created in the next version as compared with the previous one.
 void createBinaryFile(java.io.File file, java.lang.String fileMode, java.io.InputStream input, long length)
          Invoke this method if some binary file content has been created in the next version as compared with the previous one.
 void createTextFile(java.io.File file, java.lang.String fileMode, java.io.InputStream input, long length, byte[] lineSeparator)
          Invoke this method if some text file has been created in the next version as compared with the previous one.
 
Methods inherited from interface jetbrains.buildServer.vcs.patches.PatchBuilderBase
createDirectory, deleteDirectory, deleteFile, renameDirectory, renameFile, setLastModified, setWorkingDirectory
 

Method Detail

changeOrCreateTextFile

void changeOrCreateTextFile(java.io.File localFile,
                            java.lang.String fileMode,
                            java.io.InputStream input,
                            long length,
                            byte[] lineSeparator)
                            throws java.io.IOException
Invoke this method if some text file content has been changed or text file has been created in the next version as compared with the previous one.

Parameters:
localFile - file relative to the current working directory
fileMode - file mode in the linux style. If it doesn't matter for you set it to null. Set this parameter to not null if its value changes something, for example, pass "ugo+x" if you want the file to be executable and null otherwise. It is performance issue because set file mode will create a lot of processes on the Linux.
input - input stream containing the file content. This stream is guaranteed to be utilized within the call. So it can be safely closed/destroyed right after the invocation.
length - length of the content.
lineSeparator - text content line separator. Set null if you want to use system dependant separators. Use "changeOrCreateBinaryFile" if you want file to keep existing separators.
Throws:
java.io.IOException - thrown if patch collecting process failed.

changeOrCreateBinaryFile

void changeOrCreateBinaryFile(java.io.File file,
                              java.lang.String fileMode,
                              java.io.InputStream input,
                              long length)
                              throws java.io.IOException
Invoke this method if some binary file content has been changed or binary file has been created in the next version as compared with the previous one. This method can be used for text file also if you want to keep existing line separators inside the file.

Parameters:
file - file relative to the current working directory.
fileMode - file mode in the linux style. If it doesn't matter for you set it to null. Set this parameter to not null if its value changes something, for example, pass "ugo+x" if you want the file to be executable and null otherwise. It is performance issue because set file mode will create a lot of processes on the Linux.
input - input stream containing the file content. This stream is guaranteed to be utilized within the call. So it can be safely closed/destroyed right after the invocation.
length - length of the content.
Throws:
java.io.IOException - thrown if patch collecting process failed.

createBinaryFile

void createBinaryFile(java.io.File file,
                      java.lang.String fileMode,
                      java.io.InputStream input,
                      long length)
                      throws java.io.IOException
Invoke this method if some binary file content has been created in the next version as compared with the previous one. This method can be used for text file also if you want to keep existing line separators inside the file.

Parameters:
file - file relative to the current working directory.
fileMode - file mode in the linux style. If it doesn't matter for you set it to null. Set this parameter to not null if its value changes something, for example, pass "ugo+x" if you want the file to be executable and null otherwise. It is performance issue because set file mode will create a lot of processes on the Linux.
input - input stream containing the file content. This stream is guaranteed to be utilized within the call. So it can be safely closed/destroyed right after the invocation.
length - length of the content.
Throws:
java.io.IOException - thrown if patch collecting process failed.

createTextFile

void createTextFile(java.io.File file,
                    java.lang.String fileMode,
                    java.io.InputStream input,
                    long length,
                    byte[] lineSeparator)
                    throws java.io.IOException
Invoke this method if some text file has been created in the next version as compared with the previous one.

Parameters:
file - file relative to the current working directory
fileMode - file mode in the linux style. If it doesn't matter for you set it to null. Set this parameter to not null if its value changes something, for example, pass "ugo+x" if you want the file to be executable and null otherwise. It is performance issue because set file mode will create a lot of processes on the Linux.
input - input stream containing the file content. This stream is guaranteed to be utilized within the call. So it can be safely closed/destroyed right after the invocation.
length - length of the content.
lineSeparator - text content line separator. Set null if you want to use system dependant separators. Use "createBinaryFile" if you want file to keep existing separators.
Throws:
java.io.IOException - thrown if patch collecting process failed.