/** * Fluent setter. * * @param uri The URI of the request. * @return This object (for method chaining). */ @Override /* MockHttpRequest */ public MockServletRequest uri(String uri) { this.uri = emptyIfNull(uri); return this; }
/** * Fluent setter. * * @param uri The URI of the request. * @return This object (for method chaining). */ @Override /* MockHttpRequest */ public MockServletRequest uri(String uri) { this.uri = emptyIfNull(uri); return this; }
/** * Fluent setter. * * @param uri The URI of the request. * @return This object (for method chaining). */ @Override /* MockHttpRequest */ public MockServletRequest uri(String uri) { this.uri = emptyIfNull(uri); return this; }
@Override /* ConfigStore */ public synchronized String read(String name) { return emptyIfNull(cache.get(name)); }
@Override /* ConfigStore */ public synchronized String read(String name) { return emptyIfNull(cache.get(name)); }
@Override /* ConfigStore */ public synchronized String read(String name) { return emptyIfNull(cache.get(name)); }
@Override /* Object */ public String toString() { return emptyIfNull(getLocalizedMessage()); } }
@Override /* Object */ public String toString() { return emptyIfNull(getLocalizedMessage()); } }
/** * Fluent-style put method. * * @param httpMethodName The HTTP method name. * @param operation The operation. * @return This method (for method chaining). */ public OperationMap append(String httpMethodName, Operation operation) { put(emptyIfNull(httpMethodName).toLowerCase(), operation); return this; } }
@Override /* ConfigStore */ public synchronized String read(String name) throws IOException { String s = cache.get(name); if (s != null) return s; ClassLoader cl = Thread.currentThread().getContextClassLoader(); try (InputStream in = cl.getResourceAsStream(name)) { if (in != null) cache.put(name, IOUtils.read(in, IOUtils.UTF8)); } return emptyIfNull(cache.get(name)); }
/** * Fluent-style put method. * * @param httpMethodName The HTTP method name. * @param operation The operation. * @return This method (for method chaining). */ public OperationMap append(String httpMethodName, Operation operation) { put(emptyIfNull(httpMethodName).toLowerCase(), operation); return this; } }
@Override /* ConfigStore */ public synchronized String read(String name) throws IOException { String s = cache.get(name); if (s != null) return s; ClassLoader cl = Thread.currentThread().getContextClassLoader(); try (InputStream in = cl.getResourceAsStream(name)) { if (in != null) cache.put(name, IOUtils.read(in, IOUtils.UTF8)); } return emptyIfNull(cache.get(name)); }
/** * Fluent-style put method. * * @param httpMethodName The HTTP method name. * @param operation The operation. * @return This method (for method chaining). */ public OperationMap append(String httpMethodName, Operation operation) { put(emptyIfNull(httpMethodName).toLowerCase(), operation); return this; } }
@Override /* ConfigStore */ public synchronized String read(String name) throws IOException { String s = cache.get(name); if (s != null) return s; ClassLoader cl = Thread.currentThread().getContextClassLoader(); try (InputStream in = cl.getResourceAsStream(name)) { if (in != null) cache.put(name, IOUtils.read(in, IOUtils.UTF8)); } return emptyIfNull(cache.get(name)); }
@Override /* Object */ public String toString() { return emptyIfNull(getLocalizedMessage()); } }
/** * Same as {@link #read(Object)} but appends all the input into a single String. * * @param in The objects to read. * @return The objects serialized to a string, never <jk>null</jk>. * @throws IOException */ public static String readAll(Object...in) throws IOException { if (in.length == 1) return read(in[0]); StringWriter sw = new StringWriter(); for (Object o : in) sw.write(emptyIfNull(read(o))); return sw.toString(); }
/** * Same as {@link #read(Object)} but appends all the input into a single String. * * @param in The objects to read. * @return The objects serialized to a string, never <jk>null</jk>. * @throws IOException */ public static String readAll(Object...in) throws IOException { if (in.length == 1) return read(in[0]); StringWriter sw = new StringWriter(); for (Object o : in) sw.write(emptyIfNull(read(o))); return sw.toString(); }
/** * Same as {@link #read(Object)} but appends all the input into a single String. * * @param in The objects to read. * @return The objects serialized to a string, never <jk>null</jk>. * @throws IOException */ public static String readAll(Object...in) throws IOException { if (in.length == 1) return read(in[0]); StringWriter sw = new StringWriter(); for (Object o : in) sw.write(emptyIfNull(read(o))); return sw.toString(); }
return a.append(needsNormalize ? normalize(uri) : uri); if (resolution == NONE && ! isSpecialUri(uri)) return a.append(emptyIfNull(uri)); if (resolution == ROOT_RELATIVE && startsWith(uri, '/')) return a.append(needsNormalize ? normalize(uri) : uri);
return a.append(needsNormalize ? normalize(uri) : uri); if (resolution == NONE && ! isSpecialUri(uri)) return a.append(emptyIfNull(uri)); if (resolution == ROOT_RELATIVE && startsWith(uri, '/')) return a.append(needsNormalize ? normalize(uri) : uri);