Top Description Constructors Methods
org.eclipse.jgit.util.io

public final Class EolStreamTypeUtil

extends Object
Class Inheritance
Imports
java.io.InputStream, .OutputStream, java.util.EnumSet, org.eclipse.jgit.attributes.Attributes, org.eclipse.jgit.lib.CoreConfig.EolStreamType, org.eclipse.jgit.treewalk.TreeWalk.OperationType, .WorkingTreeOptions, org.eclipse.jgit.util.SystemReader, org.eclipse.jgit.util.io.AutoLFInputStream.StreamFlag

Utility used to create input and output stream wrappers for org.eclipse.jgit.lib.CoreConfig.EolStreamType
Since
4.3

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static CoreConfig.EolStreamType
private static CoreConfig.EolStreamType
public static CoreConfig.EolStreamType

Returns:

the stream conversion org.eclipse.jgit.lib.CoreConfig.EolStreamType to be performed for the selected org.eclipse.jgit.treewalk.TreeWalk.OperationType
detectStreamType
(TreeWalk.OperationType
is the org.eclipse.jgit.treewalk.TreeWalk.OperationType of the current traversal
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
private static CoreConfig.EolStreamType
public static InputStream

Returns:

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType
wrapInputStream
(InputStream
original stream
in
,
CoreConfig.EolStreamType
to be performed
conversion
)

Wrap the input stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

public static InputStream

Returns:

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType
wrapInputStream
(InputStream
original stream
in
,
CoreConfig.EolStreamType
to be performed
conversion
,
boolean
whether the stream is for checking out from the repository
forCheckout
)

Wrap the input stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

public static OutputStream

Returns:

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType
wrapOutputStream
(OutputStream
original stream
out
,
CoreConfig.EolStreamType
to be performed
conversion
)

Wrap the output stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EolStreamTypeUtilback to summary
private EolStreamTypeUtil()

Method Detail

checkInStreamTypeback to summary
private static CoreConfig.EolStreamType checkInStreamType(WorkingTreeOptions options, Attributes attrs)
checkOutStreamTypeback to summary
private static CoreConfig.EolStreamType checkOutStreamType(WorkingTreeOptions options, Attributes attrs)
detectStreamTypeback to summary
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:TreeWalk.OperationType

is the org.eclipse.jgit.treewalk.TreeWalk.OperationType of the current traversal

options:WorkingTreeOptions

are the org.eclipse.jgit.lib.Config options with key org.eclipse.jgit.treewalk.WorkingTreeOptions#KEY

attrs:Attributes

are the org.eclipse.jgit.attributes.Attributes of the file for which the org.eclipse.jgit.lib.CoreConfig.EolStreamType is to be detected

Returns:CoreConfig.EolStreamType

the stream conversion org.eclipse.jgit.lib.CoreConfig.EolStreamType to be performed for the selected org.eclipse.jgit.treewalk.TreeWalk.OperationType

getOutputFormatback to summary
private static CoreConfig.EolStreamType getOutputFormat(WorkingTreeOptions options)
wrapInputStreamback to summary
public static InputStream wrapInputStream(InputStream in, CoreConfig.EolStreamType conversion)

Wrap the input stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

Parameters
in:InputStream

original stream

conversion:CoreConfig.EolStreamType

to be performed

Returns:InputStream

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType

wrapInputStreamback to summary
public static InputStream wrapInputStream(InputStream in, CoreConfig.EolStreamType conversion, boolean forCheckout)

Wrap the input stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

Parameters
in:InputStream

original stream

conversion:CoreConfig.EolStreamType

to be performed

forCheckout:boolean

whether the stream is for checking out from the repository

Returns:InputStream

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType

Since
5.9
wrapOutputStreamback to summary
public static OutputStream wrapOutputStream(OutputStream out, CoreConfig.EolStreamType conversion)

Wrap the output stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType.

Parameters
out:OutputStream

original stream

conversion:CoreConfig.EolStreamType

to be performed

Returns:OutputStream

the converted stream depending on org.eclipse.jgit.lib.CoreConfig.EolStreamType