1 38 package com.gargoylesoftware.htmlunit.html; 39 40 import java.io.File ; 41 import java.util.Map ; 42 43 import com.gargoylesoftware.htmlunit.KeyDataPair; 44 import com.gargoylesoftware.htmlunit.KeyValuePair; 45 46 53 public class HtmlFileInput extends HtmlInput { 54 55 61 public HtmlFileInput( final HtmlPage page, final Map attributes ) { 62 super( page, attributes ); 63 } 64 65 75 public KeyValuePair[] getSubmitKeyValuePairs() { 76 final File file = new File (getValueAttribute()); 77 78 final String contentType = getPage().getWebClient().guessContentType(file); 82 final String charset = getPage().getPageEncoding(); 83 return new KeyValuePair[] { new KeyDataPair(getNameAttribute(), file, contentType, 84 charset) }; 85 } 86 87 } 88 | Popular Tags |