1 // Copyright (C) 1999-2001 by Jason Hunter <jhunter_AT_acm_DOT_org>. 2 // All rights reserved. Use of this class is limited. 3 // Please see the LICENSE for more information. 4 5 package com.oreilly.servlet.multipart; 6 7 /** 8 * A <code>Part</code> is an abstract upload part which represents an 9 * <code>INPUT</code> form element in a <code>multipart/form-data</code> form 10 * submission. 11 * 12 * @see FilePart 13 * @see ParamPart 14 * 15 * @author Geoff Soutter 16 * @version 1.0, 2000/10/27, initial revision 17 */ 18 public abstract class Part { 19 private String name; 20 21 /** 22 * Constructs an upload part with the given name. 23 */ 24 Part(String name) { 25 this.name = name; 26 } 27 28 /** 29 * Returns the name of the form element that this Part corresponds to. 30 * 31 * @return the name of the form element that this Part corresponds to. 32 */ 33 public String getName() { 34 return name; 35 } 36 37 /** 38 * Returns true if this Part is a FilePart. 39 * 40 * @return true if this is a FilePart. 41 */ 42 public boolean isFile() { 43 return false; 44 } 45 46 /** 47 * Returns true if this Part is a ParamPart. 48 * 49 * @return true if this is a ParamPart. 50 */ 51 public boolean isParam() { 52 return false; 53 } 54 } 55