Class NetRC

java.lang.Object
org.eclipse.jgit.transport.NetRC

public class NetRC extends Object
NetRC file parser.
Since:
3.5
  • Field Details

    • NETRC

      static final Pattern NETRC
    • DEFAULT_ENTRY

      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.
      See Also:
    • netrc

      private File netrc
    • lastModified

      private Instant lastModified
    • hosts

      private Map<String,NetRC.NetRCEntry> hosts
    • STATE

      private static final TreeMap<String,NetRC.State> STATE
  • Constructor Details

    • NetRC

      public NetRC()

      Constructor for NetRC.

    • NetRC

      public NetRC(File netrc)

      Constructor for NetRC.

      Parameters:
      netrc - the .netrc file
  • Method Details

    • getDefaultFile

      private static File getDefaultFile()
    • getEntry

      public NetRC.NetRCEntry getEntry(String host)
      Get entry by host name
      Parameters:
      host - the host name
      Returns:
      entry associated with host name or null
    • getEntries

      public Collection<NetRC.NetRCEntry> getEntries()
      Get all entries collected from .netrc file
      Returns:
      all entries collected from .netrc file
    • parse

      private void parse()