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 * https://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 import io.netty.buffer.ByteBuf; 19 20 /** 21 * FileUpload interface that could be in memory, on temporary file or any other implementations. 22 * 23 * Most methods are inspired from java.io.File API. 24 */ 25 public interface FileUpload extends HttpData { 26 /** 27 * Returns the original filename in the client's filesystem, 28 * as provided by the browser (or other client software). 29 * @return the original filename 30 */ 31 String getFilename(); 32 33 /** 34 * Set the original filename 35 */ 36 void setFilename(String filename); 37 38 /** 39 * Set the Content Type passed by the browser if defined 40 * @param contentType Content Type to set - must be not null 41 */ 42 void setContentType(String contentType); 43 44 /** 45 * Returns the content type passed by the browser or null if not defined. 46 * @return the content type passed by the browser or null if not defined. 47 */ 48 String getContentType(); 49 50 /** 51 * Set the Content-Transfer-Encoding type from String as 7bit, 8bit or binary 52 */ 53 void setContentTransferEncoding(String contentTransferEncoding); 54 55 /** 56 * Returns the Content-Transfer-Encoding 57 * @return the Content-Transfer-Encoding 58 */ 59 String getContentTransferEncoding(); 60 61 @Override 62 FileUpload copy(); 63 64 @Override 65 FileUpload duplicate(); 66 67 @Override 68 FileUpload retainedDuplicate(); 69 70 @Override 71 FileUpload replace(ByteBuf content); 72 73 @Override 74 FileUpload retain(); 75 76 @Override 77 FileUpload retain(int increment); 78 79 @Override 80 FileUpload touch(); 81 82 @Override 83 FileUpload touch(Object hint); 84 }