1 32 33 package org.apache.commons.httpclient.contrib.methods.multipart; 34 35 import java.io.File ; 36 import java.io.FileNotFoundException ; 37 38 import org.apache.commons.httpclient.methods.multipart.FilePart; 39 import org.apache.commons.httpclient.methods.multipart.PartSource; 40 41 51 public class ContentTypeFilePart extends FilePart { 52 53 60 public ContentTypeFilePart(String name, PartSource partSource, String charset) { 61 super(name, partSource, ContentType.get(partSource.getFileName()), charset); 62 } 63 64 70 public ContentTypeFilePart(String name, PartSource partSource) { 71 this(name, partSource, null); 72 } 73 74 81 public ContentTypeFilePart(String name, File file) throws FileNotFoundException { 82 this(name, file, null); 83 } 84 85 93 public ContentTypeFilePart(String name, File file, String charset) 94 throws FileNotFoundException { 95 super(name, file, ContentType.get(file), charset); 96 } 97 98 106 public ContentTypeFilePart(String name, String fileName, File file) 107 throws FileNotFoundException { 108 super(name, fileName, file, ContentType.get(fileName), null); 109 } 110 111 120 public ContentTypeFilePart(String name, String fileName, File file, 121 String charset) throws FileNotFoundException { 122 super(name, fileName, file, ContentType.get(file), charset); 123 } 124 } 125 | Popular Tags |