Binds webapp to address

@param user User class for the web application
@param url  Url to bind to, myst begin and end with /, like /foo/bar/
@return This JwwfServer
961862
public JwwfServer bindWebapp(final Class<? extends User> user, String url) {
		if (!url.endsWith("/"))
			url = url + "/";

		context.addServlet(new ServletHolder(new WebClientServelt(clientCreator)), url + "");
		context.addServlet(new ServletHolder(new SkinServlet()), url + "__jwwf/skins/*");
		ServletHolder fontServletHolder = new ServletHolder(new ResourceServlet());
		fontServletHolder.setInitParameter("basePackage", "net/magik6k/jwwf/assets/fonts");
		context.addServlet(fontServletHolder, url + "__jwwf/fonts/*");
		context.addServlet(new ServletHolder(new APISocketServlet(new UserFactory() {

			@Override
			public User createUser() {
				try {
					User u = user.getDeclaredConstructor().newInstance();
					u.setServer(jwwfServer);
					return u;
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		})), url + "__jwwf/socket");

		for (JwwfPlugin plugin : plugins) {
			if (plugin instanceof IPluginWebapp)
				((IPluginWebapp) plugin).onWebappBound(this, url);
		}

		return this;
	}
974478
public static SignedJWT generateJWToken(User user, App app) {
		if (app != null) {
			try {
				Date now = new Date();
				JWTClaimsSet.Builder claimsSet = new JWTClaimsSet.Builder();
				String userSecret = "";
				claimsSet.issueTime(now);
				claimsSet.expirationTime(new Date(now.getTime() + (app.getTokenValiditySec() * 1000)));
				claimsSet.notBeforeTime(now);
				claimsSet.claim("refresh", getNextRefresh(app.getTokenValiditySec()));
				claimsSet.claim(Config._APPID, app.getId());
				if (user != null) {
					claimsSet.subject(user.getId());
					userSecret = user.getTokenSecret();
				}
				JWSSigner signer = new MACSigner(app.getSecret() + userSecret);
				SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet.build());
				signedJWT.sign(signer);
				return signedJWT;
			} catch (JOSEException e) {
				logger.warn("Unable to sign JWT: {}.", e.getMessage());
			}
		}
		return null;
	}
807418
public PathImpl fsWalk(String userPath,
                     Map<String,Object> attributes,
                     String uri)
  {
    String path;
    String query = null;
    int queryIndex = uri.indexOf('?');
    if (queryIndex >= 0) {
      path = uri.substring(0, queryIndex);
      query = uri.substring(queryIndex + 1);
    } else
      path = uri;

    if (path.length() == 0)
      path = "/";

    return create(_root, userPath, attributes, path, query);
  }
616643
@SuppressWarnings("unchecked")
	private void addURL(URL url) throws Exception {
		URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
		Class clazz = URLClassLoader.class;
		Method method = clazz.getDeclaredMethod("addURL", new Class[] { URL.class });
		method.setAccessible(true);
		method.invoke(classLoader, new Object[] { url });
	}
972461
public String lookupUser(String url) throws FlickrException {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("method", METHOD_LOOKUP_USER);

        parameters.put("url", url);

        Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret);
        if (response.isError()) {
            throw new FlickrException(response.getErrorCode(), response.getErrorMessage());
        }

        Element payload = response.getPayload();
        Element groupnameElement = (Element) payload.getElementsByTagName("username").item(0);
        return ((Text) groupnameElement.getFirstChild()).getData();
    }
139464
public static Connection connect(final Driver driver, final String url,
                                     final String user, final String pass) 
        throws SQLException {
        
        final Properties props = new Properties();

        props.put("user", user);
        props.put("password", pass);

        return driver.connect(url, props);
    }
1234967
public E registerUser(E user, HttpServletRequest request) throws Exception {

        String email = user.getEmail();

        // check if a user with the email already exists
        E existingUser = dao.findByEmail(email);

        if (existingUser != null) {
            final String errorMessage = "User with eMail '" + email + "' already exists.";
            LOG.info(errorMessage);
            throw new Exception(errorMessage);
        }

        user = (E) this.persistNewUser(user, true);

        // create a token for the user and send an email with an "activation" link
        registrationTokenService.sendRegistrationActivationMail(request, user);

        return user;
    }
293128
public static URL createUrl(String url) {
        try {
            return new URL(url);
        } catch (MalformedURLException e) {
            throw new SdkClientException("Could not create URL: " + url, e);
        }
    }
410756
@Programmatic
    public List<CommandJdo> findRecentByUser(final String user) {
        return repositoryService.allMatches(
                new QueryDefault<>(CommandJdo.class, "findRecentByUser", "user", user));

    }
1227346
public Request<User> create(User user) {
        Asserts.assertNotNull(user, "user");

        String url = baseUrl
                .newBuilder()
                .addPathSegments("api/v2/users")
                .build()
                .toString();
        CustomRequest<User> request = new CustomRequest<>(this.client, url, "POST", new TypeReference<User>() {
        });
        request.addHeader("Authorization", "Bearer " + apiToken);
        request.setBody(user);
        return request;
    }
1342661
public static void addURL(URL u) throws IOException {
        if (!(ClassLoader.getSystemClassLoader() instanceof URLClassLoader)) {
            return;
        }

        URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
        URL[] urls = sysLoader.getURLs();
        for (int i = 0; i < urls.length; i++) {
            if (StringUtils.equalsIgnoreCase(urls[i].toString(), u.toString())) {
                if (log.isDebugEnabled()) {
                    log.debug("URL " + u + " is already in the CLASSPATH");
                }
                return;
            }
        }
        Class<URLClassLoader> sysclass = URLClassLoader.class;
        try {
            Method method = sysclass.getDeclaredMethod("addURL", parameters);
            method.setAccessible(true);
            method.invoke(sysLoader, new Object[]{u});
        } catch (Throwable t) {
            t.printStackTrace();
            throw new IOException("Error, could not add URL to system classloader");
        }
    }
1098115
public Builder getResource(String queryUrl) throws Exception {
    if (debug)
      LOGGER.log(Level.INFO, queryUrl);
    WebResource wrs = client.resource(queryUrl);
    Builder result = wrs.header("USER-AGENT", USER_AGENT);
    return result;
  }
352152
public String addUserParamsToURL(String strURL)
    {
        strURL = Util.addURLParam(strURL, Constants.SYSTEM_NAME, this.getProperty(Constants.SYSTEM_NAME), false);
        strURL = Util.addURLParam(strURL, Params.USER_ID, this.getProperty(Params.USER_ID));
        if (this.getProperty(Params.AUTH_TOKEN) != null)
            strURL = Util.addURLParam(strURL, Params.AUTH_TOKEN, this.getProperty(Params.AUTH_TOKEN));
    	return strURL;
    }
949750
public static boolean acceptsUrl(String url) {
    return (url != null) && (url.startsWith("jdbc:mariadb:")
        || (url.startsWith("jdbc:mysql:") && !url.contains(DISABLE_MYSQL_URL)));
  }
205418
public static ClientConfigurationBuilder builder(final String url, final String username, final String password) {
        return new ClientConfigurationBuilder(url, username, password);
    }
410158
public void jdbc(String driver, String url, String user, String password) {
        connectionWrapper.setConnectionSpec(new ConnectionJdbcSpec(driver, url, user, password));
    }
392516
protected String userTenancyPathForCached(final ApplicationUser applicationUser) {
        return queryResultsCache.execute(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return userTenancyPathFor(applicationUser);
            }
        }, TenantedAuthorizationFacetDefault.class, "userTenancyPathFor", applicationUser);
    }