Top Description Inners Fields Constructors Methods
org.eclipse.jgit.transport

public Class NetRC

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.UTF_8

NetRC file parser.
Since
3.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
NetRC.NetRCEntry

.netrc file entry

pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv static final String
DEFAULT_ENTRY

'default' netrc entry.

private Map<String, NetRC.NetRCEntry>
private Instant
pack-priv static final Pattern
private File
private static final TreeMap<String, NetRC.State>

Constructor Summary

AccessConstructor and Description
public
NetRC()

Constructor for NetRC.

public
NetRC(File
the .netrc file
netrc
)

Constructor for NetRC.

Method Summary

Modifier and TypeMethod and Description
private static File
public Collection<NetRC.NetRCEntry>

Returns:

all entries collected from .netrc file
getEntries
()

Get all entries collected from .netrc file

public NetRC.NetRCEntry

Returns:

entry associated with host name or null
getEntry
(String
the host name
host
)

Get entry by host name

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_ENTRYback to summary
pack-priv static final String DEFAULT_ENTRY

'default' netrc entry. This is the same as machine name except that default matches any name. There can be only one default token, and it must be after all machine tokens.

hostsback to summary
private Map<String, NetRC.NetRCEntry> hosts
lastModifiedback to summary
private Instant lastModified
NETRCback to summary
pack-priv static final Pattern NETRC
netrcback to summary
private File netrc
STATEback to summary
private static final TreeMap<String, NetRC.State> STATE

Constructor Detail

NetRCback to summary
public NetRC()

Constructor for NetRC.

NetRCback to summary
public NetRC(File netrc)

Constructor for NetRC.

Parameters
netrc:File

the .netrc file

Method Detail

getDefaultFileback to summary
private static File getDefaultFile()
getEntriesback to summary
public Collection<NetRC.NetRCEntry> getEntries()

Get all entries collected from .netrc file

Returns:Collection<NetRC.NetRCEntry>

all entries collected from .netrc file

getEntryback to summary
public NetRC.NetRCEntry getEntry(String host)

Get entry by host name

Parameters
host:String

the host name

Returns:NetRC.NetRCEntry

entry associated with host name or null

parseback to summary
private void parse()
org.eclipse.jgit.transport back to summary

public Class NetRC.NetRCEntry

extends Object
Class Inheritance

.netrc file entry

Field Summary

Modifier and TypeField and Description
public String
account

account netrc entry

public String
login

login netrc entry

public String
macbody

macro script body of macdef entry.

public String
macdef

macdef netrc entry.

public String
machine

machine netrc entry

public char[]
password

password netrc entry

Constructor Summary

AccessConstructor and Description
public
NetRCEntry()

Default constructor

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accountback to summary
public String account

account netrc entry

loginback to summary
public String login

login netrc entry

macbodyback to summary
public String macbody

macro script body of macdef entry.

macdefback to summary
public String macdef

macdef netrc entry. Defines a macro. This token functions like the ftp macdef command functions. A macro is defined with the specified name; its contents begins with the next .netrc line and continues until a null line (consecutive new-line characters) is encountered. If a macro named init is defined, it is automatically executed as the last step in the auto-login process.

machineback to summary
public String machine

machine netrc entry

passwordback to summary
public char[] password

password netrc entry

Constructor Detail

NetRCEntryback to summary
public NetRCEntry()

Default constructor

Method Detail

completeback to summary
pack-priv boolean complete()
org.eclipse.jgit.transport back to summary

pack-priv final Enum NetRC.State

extends Enum<NetRC.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final NetRC.State
public static final NetRC.State
public static final NetRC.State
public static final NetRC.State
public static final NetRC.State
public static final NetRC.State
public static final NetRC.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static NetRC.State
public static NetRC.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ACCOUNTback to summary
public static final NetRC.State ACCOUNT
COMMANDback to summary
public static final NetRC.State COMMAND
DEFAULTback to summary
public static final NetRC.State DEFAULT
LOGINback to summary
public static final NetRC.State LOGIN
MACDEFback to summary
public static final NetRC.State MACDEF
MACHINEback to summary
public static final NetRC.State MACHINE
PASSWORDback to summary
public static final NetRC.State PASSWORD

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static NetRC.State valueOf(String name)
valuesback to summary
public static NetRC.State[] values()