Package org.eclipse.jgit.transport
Class NetRC
- java.lang.Object
-
- org.eclipse.jgit.transport.NetRC
-
public class NetRC extends java.lang.Object
NetRC file parser.- Since:
- 3.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NetRC.NetRCEntry
.netrc file entry(package private) static class
NetRC.State
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
DEFAULT_ENTRY
'default' netrc entry.private java.util.Map<java.lang.String,NetRC.NetRCEntry>
hosts
private java.time.Instant
lastModified
private java.io.File
netrc
(package private) static java.util.regex.Pattern
NETRC
private static java.util.TreeMap<java.lang.String,NetRC.State>
STATE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.io.File
getDefaultFile()
java.util.Collection<NetRC.NetRCEntry>
getEntries()
Get all entries collected from .netrc fileNetRC.NetRCEntry
getEntry(java.lang.String host)
Get entry by host nameprivate void
parse()
-
-
-
Field Detail
-
NETRC
static final java.util.regex.Pattern NETRC
-
DEFAULT_ENTRY
static final java.lang.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.- See Also:
- Constant Field Values
-
netrc
private java.io.File netrc
-
lastModified
private java.time.Instant lastModified
-
hosts
private java.util.Map<java.lang.String,NetRC.NetRCEntry> hosts
-
STATE
private static final java.util.TreeMap<java.lang.String,NetRC.State> STATE
-
-
Method Detail
-
getDefaultFile
private static java.io.File getDefaultFile()
-
getEntry
public NetRC.NetRCEntry getEntry(java.lang.String host)
Get entry by host name- Parameters:
host
- the host name- Returns:
- entry associated with host name or null
-
getEntries
public java.util.Collection<NetRC.NetRCEntry> getEntries()
Get all entries collected from .netrc file- Returns:
- all entries collected from .netrc file
-
parse
private void parse()
-
-