View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
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,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kns.web.struts.form;
17  
18  import org.apache.struts.upload.FormFile;
19  
20  import java.io.FileNotFoundException;
21  import java.io.IOException;
22  import java.io.InputStream;
23  import java.io.Serializable;
24  
25  /**
26   * Empty FormFile instance, used to clear out FormFile attributes of Struts forms.
27   * 
28   * 
29   */
30  public class BlankFormFile implements FormFile, Serializable {
31      public void destroy() {
32      }
33  
34      public String getContentType() {
35          throw new UnsupportedOperationException();
36      }
37  
38      public byte[] getFileData() throws FileNotFoundException, IOException {
39          throw new UnsupportedOperationException();
40      }
41  
42      public String getFileName() {
43          return "";
44      }
45  
46      public int getFileSize() {
47          return 0;
48      }
49  
50      public InputStream getInputStream() throws FileNotFoundException, IOException {
51          throw new UnsupportedOperationException();
52      }
53  
54      public void setContentType(String contentType) {
55          throw new UnsupportedOperationException();
56      }
57  
58      public void setFileName(String fileName) {
59          throw new UnsupportedOperationException();
60      }
61  
62      public void setFileSize(int fileSize) {
63          throw new UnsupportedOperationException();
64      }
65  }