Java Code Examples for io.undertow.attribute.ExchangeAttributes#relativePath()

The following examples show how to use io.undertow.attribute.ExchangeAttributes#relativePath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilePredicate.java    From quarkus-http with Apache License 2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    Boolean requireContent = (Boolean)config.get("require-content");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    return new FilePredicate(value, requireContent == null ? false : requireContent);
}
 
Example 2
Source File: DirectoryPredicate.java    From quarkus-http with Apache License 2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    return new DirectoryPredicate(value);
}
 
Example 3
Source File: PathTemplatePredicate.java    From quarkus-http with Apache License 2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute match = (ExchangeAttribute) config.get("match");
    if (match == null) {
        match = ExchangeAttributes.relativePath();
    }
    String value = (String) config.get("value");
    return new PathTemplatePredicate(value, match);
}
 
Example 4
Source File: RegularExpressionPredicate.java    From quarkus-http with Apache License 2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    Boolean fullMatch = (Boolean) config.get("full-match");
    Boolean caseSensitive = (Boolean) config.get("case-sensitive");
    String pattern = (String) config.get("pattern");
    return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive);
}
 
Example 5
Source File: RewriteHandlerBuilder.java    From quarkus-http with Apache License 2.0 5 votes vote down vote up
@Override
public HandlerWrapper build(final Map<String, Object> config) {
    final ExchangeAttribute value = (ExchangeAttribute) config.get("value");

    return new HandlerWrapper() {
        @Override
        public HttpHandler wrap(HttpHandler handler) {
            return new SetAttributeHandler(handler, ExchangeAttributes.relativePath(), value);
        }
    };
}
 
Example 6
Source File: PathTemplatePredicate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute match = (ExchangeAttribute) config.get("match");
    if (match == null) {
        match = ExchangeAttributes.relativePath();
    }
    String value = (String) config.get("value");
    return new PathTemplatePredicate(value, match);
}
 
Example 7
Source File: RegularExpressionPredicate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    Boolean fullMatch = (Boolean) config.get("full-match");
    Boolean caseSensitive = (Boolean) config.get("case-sensitive");
    String pattern = (String) config.get("pattern");
    return new RegularExpressionPredicate(pattern, value, fullMatch == null ? false : fullMatch, caseSensitive == null ? true : caseSensitive);
}
 
Example 8
Source File: FilePredicate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    Boolean requireContent = (Boolean)config.get("require-content");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    return new FilePredicate(value, requireContent == null ? false : requireContent);
}
 
Example 9
Source File: DirectoryPredicate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Predicate build(final Map<String, Object> config) {
    ExchangeAttribute value = (ExchangeAttribute) config.get("value");
    if(value == null) {
        value = ExchangeAttributes.relativePath();
    }
    return new DirectoryPredicate(value);
}
 
Example 10
Source File: RewriteHandlerBuilder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public HandlerWrapper build(final Map<String, Object> config) {
    final ExchangeAttribute value = (ExchangeAttribute) config.get("value");

    return new HandlerWrapper() {
        @Override
        public HttpHandler wrap(HttpHandler handler) {
            return new SetAttributeHandler(handler, ExchangeAttributes.relativePath(), value);
        }
    };
}