@Override URIish getURI() { return uri.setPath(objectsPath); }
@Override URIish getURI() { URIish u = new URIish(); u = u.setScheme(S3_SCHEME); u = u.setHost(bucketName); u = u.setPath("/" + objectsKey); //$NON-NLS-1$ return u; }
@Override URIish getURI() { return uri.setPath(objectsPath); }
@Override URIish getURI() { return uri.setPath(objectsPath); }
public void modifyText(final ModifyEvent e) { setURI(uri.setPath(nullString(pathText.getText()))); } });
static URIish goUp(final URIish uri) { final String originalPath = uri.getPath(); if (originalPath == null || originalPath.length() == 0 || originalPath.equals(SLASH)) { return null; } final int lastSlash; if (originalPath.endsWith(SLASH)) { lastSlash = originalPath.lastIndexOf(SLASH, originalPath.length() - 2); } else { lastSlash = originalPath.lastIndexOf(SLASH); } final String pathUpOneLevel = originalPath.substring(0, lastSlash); final URIish result; if (pathUpOneLevel.length() == 0) { result = uri.setPath(null); } else { result = uri.setPath(pathUpOneLevel); } return result; }
/** * Creates a {@link URIish} from a given string. The * {@link CredentialsProvider} uses uris as resource identifications. * * @param resourceKey * to convert * @return the uri */ private URIish toUri(String resourceKey) { try { return new URIish(resourceKey); } catch (URISyntaxException e) { return new URIish().setPath(resourceKey); // Doesn't check!! } }
@Override URIish getURI() { URIish u = new URIish(); u = u.setScheme(S3_SCHEME); u = u.setHost(bucketName); u = u.setPath("/" + objectsKey); //$NON-NLS-1$ return u; }
@Override URIish getURI() { URIish u = new URIish(); u = u.setScheme(S3_SCHEME); u = u.setHost(bucketName); u = u.setPath("/" + objectsKey); //$NON-NLS-1$ return u; }
@Override URIish getURI() { URIish u = new URIish(); u = u.setScheme(S3_SCHEME); u = u.setHost(bucketName); u = u.setPath("/" + objectsKey); //$NON-NLS-1$ return u; }
@Override public URIish getFetchUrl() { return new URIish().setScheme("ssh").setUser("git").setHost("github.com").setPath(props.getProperty(ENV_GITHUB)); }
private static Protocol.ExpiringAction getSshAuthentication( Repository db, String purpose, String remoteUrl, URIish u) throws IOException, CommandFailedException { AuthCache cached = sshAuthCache.get(remoteUrl); Protocol.ExpiringAction action = null; if (cached != null && cached.validUntil > System.currentTimeMillis()) { action = cached.cachedAction; } if (action == null) { // discover and authenticate; git-lfs does "ssh // -p <port> -- <host> git-lfs-authenticate // <project> <upload/download>" String json = SshSupport.runSshCommand(u.setPath(""), //$NON-NLS-1$ null, db.getFS(), "git-lfs-authenticate " + extractProjectName(u) + " " //$NON-NLS-1$//$NON-NLS-2$ + purpose, SSH_AUTH_TIMEOUT_SECONDS); action = Protocol.gson().fromJson(json, Protocol.ExpiringAction.class); // cache the result as long as possible. AuthCache c = new AuthCache(action); sshAuthCache.put(remoteUrl, c); } return action; }
public RepositoryS3(Bucket bucket, Repository repository, AmazonS3 s3, Branch branch) { this.s3 = s3; this.bucket = bucket; this.repository = repository; this.branch = branch; this.uri = new URIish().setScheme("amazon-s3").setHost(bucket.getName()).setPath(Constants.DOT_GIT); }
URIish uri = new URIish().setPath(path.toString()); if (!askUser(provider, uri, // format(SshdText.get().knownHostsUserAskCreationPrompt,
private boolean match(SCM scm, URIish url) { if (scm instanceof GitSCM) { for (RemoteConfig remoteConfig : ((GitSCM) scm).getRepositories()) { for (URIish urIish : remoteConfig.getURIs()) { // needed cause the ssh and https URI differs in Bitbucket Server. if(urIish.getPath().startsWith("/scm")){ urIish = urIish.setPath(urIish.getPath().substring(4)); } LOGGER.log(Level.FINE, "Trying to match {0} ", urIish.toString() + "<-->" + url.toString()); if (GitStatus.looselyMatches(urIish, url)) { return true; } } } } else if (scm instanceof MercurialSCM) { try { URI hgUri = new URI(((MercurialSCM) scm).getSource()); String remote = url.toString(); if (looselyMatches(hgUri, remote)) { return true; } } catch (URISyntaxException ex) { LOGGER.log(Level.SEVERE, "Could not parse jobSource uri: {0} ", ex); } } return false; }