Java Code Examples for org.apache.camel.util.FileUtil#compactPath()

The following examples show how to use org.apache.camel.util.FileUtil#compactPath() . 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: BuildTimeUriResolver.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
private static String compact(String href, String scheme) {
    final String afterScheme = scheme != null ? StringHelper.after(href, scheme) : href;
    final String compacted = FileUtil.compactPath(afterScheme, '/');
    return compacted;
}
 
Example 2
Source File: WildFlyClassResolver.java    From wildfly-camel with Apache License 2.0 4 votes vote down vote up
public InputStream loadResourceAsStream(String uri) {
    IllegalArgumentAssertion.assertNotNull(uri, "uri");
    String resolvedName = FileUtil.compactPath(uri, '/');
    return classLoader.getResourceAsStream(resolvedName);
}
 
Example 3
Source File: WildFlyClassResolver.java    From wildfly-camel with Apache License 2.0 4 votes vote down vote up
public URL loadResourceAsURL(String uri) {
    IllegalArgumentAssertion.assertNotNull(uri, "uri");
    String resolvedName = FileUtil.compactPath(uri, '/');
    return classLoader.getResource(resolvedName);
}