Package org.eclipse.jgit.util.io
Class EolStreamTypeUtil
- java.lang.Object
-
- org.eclipse.jgit.util.io.EolStreamTypeUtil
-
public final class EolStreamTypeUtil extends java.lang.Object
Utility used to create input and output stream wrappers forCoreConfig.EolStreamType
- Since:
- 4.3
-
-
Constructor Summary
Constructors Modifier Constructor Description private
EolStreamTypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static CoreConfig.EolStreamType
checkInStreamType(WorkingTreeOptions options, Attributes attrs)
private static CoreConfig.EolStreamType
checkOutStreamType(WorkingTreeOptions options, Attributes attrs)
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 .gitattributesprivate static CoreConfig.EolStreamType
getOutputFormat(WorkingTreeOptions options)
static java.io.InputStream
wrapInputStream(java.io.InputStream in, CoreConfig.EolStreamType conversion)
Wrap the input stream depending onCoreConfig.EolStreamType
static java.io.OutputStream
wrapOutputStream(java.io.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.OperationType
of the current traversaloptions
- are theConfig
options with keyWorkingTreeOptions.KEY
attrs
- are theAttributes
of the file for which theCoreConfig.EolStreamType
is to be detected- Returns:
- the stream conversion
CoreConfig.EolStreamType
to be performed for the selectedTreeWalk.OperationType
-
wrapInputStream
public static java.io.InputStream wrapInputStream(java.io.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
-
wrapOutputStream
public static java.io.OutputStream wrapOutputStream(java.io.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
-
checkInStreamType
private static CoreConfig.EolStreamType checkInStreamType(WorkingTreeOptions options, Attributes attrs)
-
getOutputFormat
private static CoreConfig.EolStreamType getOutputFormat(WorkingTreeOptions options)
-
checkOutStreamType
private static CoreConfig.EolStreamType checkOutStreamType(WorkingTreeOptions options, Attributes attrs)
-
-