/** * @param dispositionString * @throws IOException */ public Disposition(String dispositionString) throws IOException { if (dispositionString == null) { throw new RuntimeException( "No content-disposition string - contact your browser vendor"); } StringTokenizer tokens = new StringTokenizer(dispositionString, ";"); while (tokens.hasMoreTokens()) { String current = tokens.nextToken(); current = current.trim(); if (current.startsWith("name")) { name = readTokenValue(current); } else { if (current.startsWith("filename")) { fileName = readTokenValue(current); } } } }