- java.lang.Object
-
- org.eclipse.jgit.util.io.EolStreamTypeUtil
-
public final class EolStreamTypeUtil extends Object
Utility used to create input and output stream wrappers forCoreConfig.EolStreamType- Since:
- 4.3
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CoreConfig.EolStreamTypedetectStreamType(TreeWalk.OperationType op, WorkingTreeOptions options, Attributes attrs)Convenience method used to detect if CRLF conversion has been configured using the global repo options global attributes info attributes working tree .gitattributesstatic InputStreamwrapInputStream(InputStream in, CoreConfig.EolStreamType conversion)Wrap the input stream depending onCoreConfig.EolStreamType.static InputStreamwrapInputStream(InputStream in, CoreConfig.EolStreamType conversion, boolean forCheckout)Wrap the input stream depending onCoreConfig.EolStreamType.static OutputStreamwrapOutputStream(OutputStream out, CoreConfig.EolStreamType conversion)Wrap the output stream depending onCoreConfig.EolStreamType.
-
-
-
Method Detail
-
detectStreamType
public static CoreConfig.EolStreamType detectStreamType(TreeWalk.OperationType op, WorkingTreeOptions options, Attributes attrs)
Convenience method used to detect if CRLF conversion has been configured using the- global repo options
- global attributes
- info attributes
- working tree .gitattributes
- Parameters:
op- is theTreeWalk.OperationTypeof the current traversaloptions- are theConfigoptions with keyWorkingTreeOptions.KEYattrs- are theAttributesof the file for which theCoreConfig.EolStreamTypeis to be detected- Returns:
- the stream conversion
CoreConfig.EolStreamTypeto be performed for the selectedTreeWalk.OperationType
-
wrapInputStream
public static InputStream wrapInputStream(InputStream in, CoreConfig.EolStreamType conversion)
Wrap the input stream depending onCoreConfig.EolStreamType.- Parameters:
in- original streamconversion- to be performed- Returns:
- the converted stream depending on
CoreConfig.EolStreamType
-
wrapInputStream
public static InputStream wrapInputStream(InputStream in, CoreConfig.EolStreamType conversion, boolean forCheckout)
Wrap the input stream depending onCoreConfig.EolStreamType.- Parameters:
in- original streamconversion- to be performedforCheckout- whether the stream is for checking out from the repository- Returns:
- the converted stream depending on
CoreConfig.EolStreamType - Since:
- 5.9
-
wrapOutputStream
public static OutputStream wrapOutputStream(OutputStream out, CoreConfig.EolStreamType conversion)
Wrap the output stream depending onCoreConfig.EolStreamType.- Parameters:
out- original streamconversion- to be performed- Returns:
- the converted stream depending on
CoreConfig.EolStreamType
-
-