URIish.getUser
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.eclipse.jgit.transport.URIish.getUser (Showing top 20 results out of 315)

  • Common ways to obtain URIish
private void myMethod () {
URIish u =
  • String s;new URIish(s)
  • new URIish()
  • new URIish(SCHEME + "://test/conn" + n)
  • Smart code suggestions by Codota
}
origin: spring-cloud/spring-cloud-config

protected static boolean isSshUri(Object uri) {
  if(uri != null) {
    try {
      URIish urIish = new URIish(uri.toString());
      String scheme = urIish.getScheme();
      if(scheme == null && hasText(urIish.getHost()) && hasText(urIish.getUser())) {
        //JGit returns null if using SCP URI but user and host will be populated
        return true;
      }
      return scheme != null && !scheme.matches("^(http|https)$");
    } catch (URISyntaxException e) {
      return false;
    }
  }
  return false;
}
origin: org.eclipse.jgit/org.eclipse.jgit

private Properties loadProperties() throws NotSupportedException {
  if (local.getDirectory() != null) {
    File propsFile = new File(local.getDirectory(), uri.getUser());
    if (propsFile.isFile())
      return loadPropertiesFile(propsFile);
  }
  File propsFile = new File(local.getFS().userHome(), uri.getUser());
  if (propsFile.isFile())
    return loadPropertiesFile(propsFile);
  Properties props = new Properties();
  String user = uri.getUser();
  String pass = uri.getPass();
  if (user != null && pass != null) {
      props.setProperty("accesskey", user); //$NON-NLS-1$
      props.setProperty("secretkey", pass); //$NON-NLS-1$
  } else
    throw new NotSupportedException(MessageFormat.format(
        JGitText.get().cannotReadFile, propsFile));
  return props;
}
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public Process exec(String command, int timeout)
    throws TransportException {
  String ssh = SystemReader.getInstance().getenv("GIT_SSH"); //$NON-NLS-1$
  boolean putty = ssh.toLowerCase(Locale.ROOT).contains("plink"); //$NON-NLS-1$
  List<String> args = new ArrayList<>();
  args.add(ssh);
  if (putty
      && !ssh.toLowerCase(Locale.ROOT).contains("tortoiseplink")) //$NON-NLS-1$
    args.add("-batch"); //$NON-NLS-1$
  if (0 < getURI().getPort()) {
    args.add(putty ? "-P" : "-p"); //$NON-NLS-1$ //$NON-NLS-2$
    args.add(String.valueOf(getURI().getPort()));
  }
  if (getURI().getUser() != null)
    args.add(getURI().getUser() + "@" + getURI().getHost()); //$NON-NLS-1$
  else
    args.add(getURI().getHost());
  args.add(command);
  ProcessBuilder pb = createProcess(args);
  try {
    return pb.start();
  } catch (IOException err) {
    throw new TransportException(err.getMessage(), err);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public int hashCode() {
  int hc = 0;
  if (getScheme() != null)
    hc = hc * 31 + getScheme().hashCode();
  if (getUser() != null)
    hc = hc * 31 + getUser().hashCode();
  if (getPass() != null)
    hc = hc * 31 + getPass().hashCode();
  if (getHost() != null)
    hc = hc * 31 + getHost().hashCode();
  if (getPort() > 0)
    hc = hc * 31 + getPort();
  if (getPath() != null)
    hc = hc * 31 + getPath().hashCode();
  return hc;
}
origin: org.eclipse.jgit/org.eclipse.jgit

if (getUser() != null) {
  r.append(escape(getUser(), true, escapeNonAscii));
  if (includePassword && getPass() != null) {
    r.append(':');
  if (getUser() != null && getUser().length() > 0)
    r.append('@');
  r.append(escape(getHost(), false, escapeNonAscii));
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
origin: org.eclipse.jgit/org.eclipse.jgit

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
origin: org.eclipse.jgit/org.eclipse.jgit

  switch (field) {
  case USER:
    if (uri.getUser() == null || uri.getUser().length() == 0)
      return false;
    break;
canHave.addAll(getOptionalFields());
if (uri.getUser() != null && !canHave.contains(URIishField.USER))
  return false;
if (uri.getPass() != null && !canHave.contains(URIishField.PASS))
origin: org.eclipse.jgit/org.eclipse.jgit

/** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
  if (!(obj instanceof URIish))
    return false;
  final URIish b = (URIish) obj;
  if (!eq(getScheme(), b.getScheme()))
    return false;
  if (!eq(getUser(), b.getUser()))
    return false;
  if (!eq(getPass(), b.getPass()))
    return false;
  if (!eq(getHost(), b.getHost()))
    return false;
  if (getPort() != b.getPort())
    return false;
  if (!eq(getPath(), b.getPath()))
    return false;
  return true;
}
origin: org.eclipse.jgit/org.eclipse.jgit

if (candidate.getUser() != null) {
  if (!candidate.getUser().equals(uri.getUser())) {
    continue;
origin: org.eclipse.jgit/org.eclipse.jgit

    return false;
} else {
  username = uri.getUser();
  password = uri.getPass();
origin: org.eclipse.egit/ui

LoginDialog(Shell shell, URIish uri) {
  super(shell);
  this.uri = uri;
  isUserSet = uri.getUser() != null && uri.getUser().length() > 0;
}
origin: org.eclipse.jgit/org.eclipse.jgit

  throws TransportException {
String user = uri.getUser();
final String pass = uri.getPass();
String host = uri.getHost();
origin: org.eclipse.egit/ui

  public void modifyText(final ModifyEvent e) {
    eventDepth++;
    try {
      if (eventDepth == 1) {
        URIish u = new URIish(uriText.getText());
        String newUser = u.getUser();
        user.setText(newUser != null ? newUser : ""); //$NON-NLS-1$
      }
    } catch (URISyntaxException e1) {
      // empty
    } finally {
      eventDepth--;
    }
    checkPage();
  }
});
origin: sonia.jgit/org.eclipse.jgit

public int hashCode() {
  int hc = 0;
  if (getScheme() != null)
    hc = hc * 31 + getScheme().hashCode();
  if (getUser() != null)
    hc = hc * 31 + getUser().hashCode();
  if (getPass() != null)
    hc = hc * 31 + getPass().hashCode();
  if (getHost() != null)
    hc = hc * 31 + getHost().hashCode();
  if (getPort() > 0)
    hc = hc * 31 + getPort();
  if (getPath() != null)
    hc = hc * 31 + getPath().hashCode();
  return hc;
}
origin: org.eclipse.egit/ui

  @Override
  public boolean handles(URIish uri) {
    if (getDefaultScheme().equals(uri.getScheme()))
      return true;
    if (uri.getHost() != null || uri.getPort() > 0
        || uri.getUser() != null || uri.getPass() != null
        || uri.getPath() == null)
      return false;
    if (uri.getScheme() == null)
      return FS.DETECTED
          .resolve(new File("."), uri.getPath()).isDirectory(); //$NON-NLS-1$
    return false;
  }
};
origin: sonia.jgit/org.eclipse.jgit

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
origin: sonia.jgit/org.eclipse.jgit

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
origin: berlam/github-bucket

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
origin: berlam/github-bucket

@Override
public boolean canHandle(URIish uri, Repository local, String remoteName) {
  if (uri.getPath() == null
      || uri.getPort() > 0
      || uri.getUser() != null
      || uri.getPass() != null
      || uri.getHost() != null
      || (uri.getScheme() != null && !getSchemes().contains(uri.getScheme())))
    return false;
  return true;
}
org.eclipse.jgit.transportURIishgetUser

Javadoc

Get user name requested for transfer

Popular methods of URIish

  • <init>
  • toString
  • getPath
  • getHost
  • getScheme
  • toPrivateString
    Obtain the string form of the URI, with the password included.
  • getPort
  • setPath
    Return a new URI matching this one, but with a different path.
  • getHumanishName
    Get the "humanish" part of the path. Some examples of a 'humanish' part for a full path:PathHumanish
  • setPort
    Return a new URI matching this one, but with a different port.
  • setScheme
    Return a new URI matching this one, but with a different scheme.
  • setUser
    Return a new URI matching this one, but with a different user.
  • setScheme,
  • setUser,
  • getPass,
  • setHost,
  • setPass,
  • getRawPath,
  • toPrivateASCIIString,
  • cleanLeadingSlashes,
  • eq

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)