Examples of IContext


Examples of org.eclipse.webdav.IContext

            URL proxyServerUrl = getProxyServerUrl(originServerUrl);
            if (proxyServerUrl == null && !matchesProxyServerException(originServerUrl)) {
                proxyServerUrl = getDefaultProxyServerUrl();
            }

            IContext context = webDAVFactory.newContext(request.getContext());

            IContext defaultContext = getContext(originServerUrl);
            if (defaultContext == null) {
                defaultContext = getDefaultContext();
            }

            if (defaultContext != null) {
                Enumeration e = defaultContext.keys();
                while (e.hasMoreElements()) {
                    String key = (String) e.nextElement();
                    context.put(key, defaultContext.get(key));
                }
            }

            if (authority != null) {
                authority.authorize(request, null, context, proxyServerUrl, true);
View Full Code Here

Examples of org.red5.server.api.IContext

        return UUID.randomUUID().toString();
    }

    public boolean storeVideo(String stream_id) {
        log.info("Storing video stream: " + stream_id);
        IContext context = new Red5().getContext();
        Resource flv = context.getResource("streams/" + stream_id + ".flv");
        try {
            AWSCredentials credentials = new AWSCredentials(s3AccessKey, s3SecretKey);
            S3Service s3 = new RestS3Service(credentials);
            S3Bucket bucket = s3.getBucket("xubu");
            File file = flv.getFile();
View Full Code Here

Examples of org.rythmengine.internal.IContext

    private static Map<String, Pattern> patterns = new HashMap<String, Pattern>();

    @Override
    public Token go() {
        IContext ctx = ctx();
        if (ctx.insideDirectiveComment()) {
            return null;
            //raiseParseException("directive comment not closed");
        }
        ICodeType type = ctx.peekCodeType();
        while (null != type) {
            String sCommentStart = type.commentStart();
            if (!S.empty(sCommentStart)) {
                sCommentStart = S.escapeRegex(sCommentStart).toString();
                // try <!-- @ first
                String s = "(" + sCommentStart + "\\s*" + ")" + ctx.getDialect().a() + ".*";
                Pattern p = patterns.get(s);
                if (null == p) {
                    p = Pattern.compile(s, Pattern.DOTALL);
                    patterns.put(s, p);
                }
                Matcher m = p.matcher(remain());
                if (m.matches()) {
                    s = m.group(1);
                    ctx.step(s.length());
                    ctx.enterDirectiveComment();
                    return Token.EMPTY_TOKEN;
                }
                // try <!-- }
                s = "(" + sCommentStart + "\\s*)\\}.*";
                p = patterns.get(s);
                if (null == p) {
                    p = Pattern.compile(s, Pattern.DOTALL);
                    patterns.put(s, p);
                }
                m = p.matcher(remain());
                if (m.matches()) {
                    s = m.group(1);
                    ctx.step(s.length());
                    ctx.enterDirectiveComment();
                    return Token.EMPTY_TOKEN;
                }
            }
            type = type.getParent();
        }
View Full Code Here

Examples of org.thymeleaf.context.IContext

       
        if (attributeValue == null || attributeValue.trim().equals("")) {
            return false;
        }
       
        final IContext context = arguments.getContext();
        if (!(context instanceof IWebContext)) {
            throw new ConfigurationException(
                    "Thymeleaf execution context is not a web context (implementation of " +
                    IWebContext.class.getName() + ". Spring Security integration can only be used in " +
                    "web environements.");
View Full Code Here

Examples of org.thymeleaf.context.IContext

        if (attributeValue == null || attributeValue.trim().equals("")) {
            return false;
        }
        attributeValue = attributeValue.trim();

        final IContext context = arguments.getContext();
        if (!(context instanceof IWebContext)) {
            throw new ConfigurationException(
                    "Thymeleaf execution context is not a web context (implementation of " +
                    IWebContext.class.getName() + ". Spring Security integration can only be used in " +
                    "web environements.");
View Full Code Here

Examples of org.thymeleaf.context.IContext

   
   
    public Map<String, Object> getAdditionalExpressionObjects(
            final IProcessingContext processingContext) {
       
        final IContext context = processingContext.getContext();
        final IWebContext webContext =
                (context instanceof IWebContext? (IWebContext)context : null);
       
        final Map<String,Object> objects = new HashMap<String, Object>(3, 1.0f);
       
View Full Code Here

Examples of org.thymeleaf.context.IContext

        final String url =
                (spaceIndex < 0? attributeValue : attributeValue.substring(spaceIndex + 1)).trim();
        final String method =
                (spaceIndex < 0? "GET" : attributeValue.substring(0, spaceIndex)).trim();

        final IContext context = arguments.getContext();
        if (!(context instanceof IWebContext)) {
            throw new ConfigurationException(
                    "Thymeleaf execution context is not a web context (implementation of " +
                    IWebContext.class.getName() + ". Spring Security integration can only be used in " +
                    "web environements.");
View Full Code Here

Examples of org.thymeleaf.context.IContext

    }

    @Override
    public MessageResolution resolveMessage(final Arguments arguments, final String key, final Object[] messageParameters) {
        logger.debug("arguments: {}, key: {}, message parameters: {}", arguments, key, messageParameters);
        final IContext context = arguments.getContext();
        final Locale locale = context.getLocale();
        final ResourceBundle resourceBundle = resourceBundleProvider.getResourceBundle(locale);
        final String string = resourceBundle.getString(key);
        final MessageFormat messageFormat = new MessageFormat(string, locale);
        final String message = messageFormat.format((messageParameters != null ? messageParameters : EMPTY_MESSAGE_PARAMETERS));
        return new MessageResolution(message);
View Full Code Here

Examples of org.thymeleaf.context.IContext

    @Override
    public InputStream getResourceAsStream(final TemplateProcessingParameters templateProcessingParameters, final String resourceName) {

        Validate.notNull(templateProcessingParameters, "Template Processing Parameters cannot be null");

        final IContext context = templateProcessingParameters.getContext();
        if (context instanceof SlingContext) {
            final SlingContext slingContext = (SlingContext) context;
            final ResourceResolver resourceResolver = slingContext.getResourceResolver();
            final Resource resource = resourceResolver.getResource(resourceName);
            return resource.adaptTo(InputStream.class);
        } else {
            throw new TemplateProcessingException("Cannot handle context: " + context.getClass().getName());
        }
    }
View Full Code Here

Examples of org.thymeleaf.context.IContext

        final Locale locale = helper.getResponse().getLocale();
        final String scriptName = helper.getScript().getScriptResource().getPath();

        try {
            final IContext context = new SlingWebContext(request, response, servletContext, locale, bindings);
            thymeleafScriptEngineFactory.getTemplateEngine().process(scriptName, context, scriptContext.getWriter());
        } catch (Exception e) {
            logger.error("Failure rendering Thymeleaf template '{}': {}", scriptName, e.getMessage());
            throw new ScriptException(e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.