/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @return An array of parsed values. */ public static String[] csvSplit(String s) { if (s==null) return null; return csvSplit(s,0,s.length()); }
/** * Parse the string representation of a list using {@link #csvSplit(List,String,int,int)} * @param s The string to parse, expected to be enclosed as '[...]' * @return An array of parsed values. */ public static String[] arrayFromString(String s) { if (s==null) return new String[]{}; if (!s.startsWith("[") || !s.endsWith("]")) throw new IllegalArgumentException(); if (s.length()==2) return new String[]{}; return csvSplit(s,1,s.length()-2); }
/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @param off The offset into the string to start parsing * @param len The len in characters to parse * @return An array of parsed values. */ public static String[] csvSplit(String s, int off,int len) { if (s==null) return null; if (off<0 || len<0 || off>s.length()) throw new IllegalArgumentException(); List<String> list = new ArrayList<>(); csvSplit(list,s,off,len); return list.toArray(new String[list.size()]); }
roleArray = StringUtil.csvSplit(roles); known.add(username); Credential credential = Credential.getCredential(credentials);
/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @return An array of parsed values. */ public static String[] csvSplit(String s) { if (s==null) return null; return csvSplit(s,0,s.length()); }
/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @return An array of parsed values. */ public static String[] csvSplit(String s) { if (s==null) return null; return csvSplit(s,0,s.length()); }
/** * Parse the string representation of a list using {@link #csvSplit(List,String,int,int)} * @param s The string to parse, expected to be enclosed as '[...]' * @return An array of parsed values. */ public static String[] arrayFromString(String s) { if (s==null) return new String[]{}; if (!s.startsWith("[") || !s.endsWith("]")) throw new IllegalArgumentException(); if (s.length()==2) return new String[]{}; return csvSplit(s,1,s.length()-2); }
/** * Parse the string representation of a list using {@link #csvSplit(List,String,int,int)} * @param s The string to parse, expected to be enclosed as '[...]' * @return An array of parsed values. */ public static String[] arrayFromString(String s) { if (s==null) return new String[]{}; if (!s.startsWith("[") || !s.endsWith("]")) throw new IllegalArgumentException(); if (s.length()==2) return new String[]{}; return csvSplit(s,1,s.length()-2); }
/** * Set the mime types. * @param types The mime types to exclude (without charset or other parameters). * For backward compatibility the mimetypes may be comma separated strings, but this * will not be supported in future versions. */ public void addExcludedMimeTypes(String... types) { for (String t : types) _mimeTypes.exclude(StringUtil.csvSplit(t)); }
/** * Add included mime types. Inclusion takes precedence over * exclusion. * @param types The mime types to include (without charset or other parameters) * For backward compatibility the mimetypes may be comma separated strings, but this * will not be supported in future versions. */ public void addIncludedMimeTypes(String... types) { for (String t : types) _mimeTypes.include(StringUtil.csvSplit(t)); }
/** * @param pathspecs Path specs (as per servlet spec) to exclude. If a * ServletContext is available, the paths are relative to the context path, * otherwise they are absolute. * For backward compatibility the pathspecs may be comma separated strings, but this * will not be supported in future versions. */ public void addExcludedPaths(String... pathspecs) { for (String p : pathspecs) _paths.exclude(StringUtil.csvSplit(p)); }
/** * Set the included filter list of HTTP Methods (replacing any previously set) * * @param csvMethods the list of methods, CSV format * @see #setExcludedMethodList(String) */ public void setIncludedMethodList(String csvMethods) { setIncludedMethods(StringUtil.csvSplit(csvMethods)); }
/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @param off The offset into the string to start parsing * @param len The len in characters to parse * @return An array of parsed values. */ public static String[] csvSplit(String s, int off,int len) { if (s==null) return null; if (off<0 || len<0 || off>s.length()) throw new IllegalArgumentException(); List<String> list = new ArrayList<>(); csvSplit(list,s,off,len); return list.toArray(new String[list.size()]); }
/** * Set the excluded filter list of HTTP Methods (replacing any previously set) * * @param csvMethods the list of methods, CSV format * @see #setIncludedMethodList(String) */ public void setExcludedMethodList(String csvMethods) { setExcludedMethods(StringUtil.csvSplit(csvMethods)); }
/** * Parse a CSV string using {@link #csvSplit(List,String, int, int)} * @param s The string to parse * @param off The offset into the string to start parsing * @param len The len in characters to parse * @return An array of parsed values. */ public static String[] csvSplit(String s, int off,int len) { if (s==null) return null; if (off<0 || len<0 || off>s.length()) throw new IllegalArgumentException(); List<String> list = new ArrayList<>(); csvSplit(list,s,off,len); return list.toArray(new String[list.size()]); }
/** * Add path specs to include. Inclusion takes precedence over exclusion. * @param pathspecs Path specs (as per servlet spec) to include. If a * ServletContext is available, the paths are relative to the context path, * otherwise they are absolute * For backward compatibility the pathspecs may be comma separated strings, but this * will not be supported in future versions. */ public void addIncludedPaths(String... pathspecs) { for (String p : pathspecs) _paths.include(StringUtil.csvSplit(p)); }
public ServletContainerInitializerOrdering (String ordering) { if (ordering != null) { _ordering = ordering; String[] tmp = StringUtil.csvSplit(ordering); for (int i=0; i<tmp.length; i++) { String s = tmp[i].trim(); _indexMap.put(s, Integer.valueOf(i)); if ("*".equals(s)) { if (_star != null) throw new IllegalArgumentException("Duplicate wildcards in ServletContainerInitializer ordering "+ordering); _star = Integer.valueOf(i); } } } }
/** * Add included MIME types for response filtering * * @param types The mime types to include (without charset or other parameters) * For backward compatibility the mimetypes may be comma separated strings, but this * will not be supported in future versions. * @see #addExcludedMimeTypes(String...) */ public void addIncludedMimeTypes(String... types) { for (String t : types) _mimeTypes.include(StringUtil.csvSplit(t)); }
/** * Adds excluded MIME types for response filtering. * * <p> * <em>Deprecation Warning: </em> * For backward compatibility the MIME types parameters may be comma separated strings, * but this will not be supported in future versions of Jetty. * </p> * * @param types The mime types to exclude (without charset or other parameters). * @see #addIncludedMimeTypes(String...) */ public void addExcludedMimeTypes(String... types) { for (String t : types) _mimeTypes.exclude(StringUtil.csvSplit(t)); }
/** * Extensible startContext. this method is called from {@link ContextHandler#doStart()} instead of a call to super.doStart(). This allows derived classes to * insert additional handling (Eg configuration) before the call to super.doStart by this method will start contained handlers. * @throws Exception if unable to start the context * * @see org.eclipse.jetty.server.handler.ContextHandler.Context */ protected void startContext() throws Exception { String managedAttributes = _initParams.get(MANAGED_ATTRIBUTES); if (managedAttributes != null) addEventListener(new ManagedAttributeListener(this,StringUtil.csvSplit(managedAttributes))); super.doStart(); // Call context listeners if (!_servletContextListeners.isEmpty()) { ServletContextEvent event = new ServletContextEvent(_scontext); for (ServletContextListener listener:_servletContextListeners) callContextInitialized(listener, event); } }