public class CleanFilter extends FilterCommandBuilt-in LFS clean filter When new content is about to be added to the git repository and this filter is configured for that content, then this filter will replace the original content with content of a so-called LFS pointer file. The pointer file content will then be added to the git repository. Additionally this filter writes the original content in a so-called 'media file' to '.git/lfs/objects/ <first-two-characters-of-contentid>/<rest-of-contentid>'
- See Also:
- Git LFS Specification
public CleanFilter(Repository db, InputStream in, OutputStream out) throws IOExceptionConstructor for CleanFilter.
db- the repository
InputStreamproviding the original content
OutputStreaminto which the content of the pointer file should be written. That's the content which will be added to the git repository
IOException- when the creation of the temporary file fails or when no
OutputStreamfor this file can be created
public int run() throws IOExceptionExecute the command. The command is supposed to read data from
FilterCommand.inand to write the result to
FilterCommand.out. It returns the number of bytes it read from
FilterCommand.in. It should be called in a loop until it returns -1 signaling that the
InputStreamis completely processed.