1 /* 2 * Copyright 2012 The Netty Project 3 * 4 * The Netty Project licenses this file to you under the Apache License, 5 * version 2.0 (the "License"); you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at: 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 */ 16 package io.netty.handler.codec.http.multipart; 17 18 /** 19 * FileUpload interface that could be in memory, on temporary file or any other implementations. 20 * 21 * Most methods are inspired from java.io.File API. 22 */ 23 public interface FileUpload extends HttpData { 24 /** 25 * Returns the original filename in the client's filesystem, 26 * as provided by the browser (or other client software). 27 * @return the original filename 28 */ 29 String getFilename(); 30 31 /** 32 * Set the original filename 33 */ 34 void setFilename(String filename); 35 36 /** 37 * Set the Content Type passed by the browser if defined 38 * @param contentType Content Type to set - must be not null 39 */ 40 void setContentType(String contentType); 41 42 /** 43 * Returns the content type passed by the browser or null if not defined. 44 * @return the content type passed by the browser or null if not defined. 45 */ 46 String getContentType(); 47 48 /** 49 * Set the Content-Transfer-Encoding type from String as 7bit, 8bit or binary 50 */ 51 void setContentTransferEncoding(String contentTransferEncoding); 52 53 /** 54 * Returns the Content-Transfer-Encoding 55 * @return the Content-Transfer-Encoding 56 */ 57 String getContentTransferEncoding(); 58 59 @Override 60 FileUpload copy(); 61 62 @Override 63 FileUpload duplicate(); 64 65 @Override 66 FileUpload retain(); 67 68 @Override 69 FileUpload retain(int increment); 70 }