Code example for FileInputStream

0
     * Adds a file to the request. 
     * @param key the key name for the new param. 
     * @param file the file to add. 
     */ 
    public void put(String key, File file) throws FileNotFoundException {
        put(key, new FileInputStream(file), file.getName());
    } 
 
    /** 
     * Adds param with more than one value. 
     * @param key the key name for the new param. 
     * @param values is the ArrayList with values for the param. 
     */ 
    public void put(String key, ArrayList<String> values)  {
        if(key != null && values != null) {
            urlParamsWithArray.put(key, values);
        } 
    } 
 
    /** 
     * Adds value to param which can have more than one value.