001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kns.web.struts.form;
017
018import org.apache.struts.upload.FormFile;
019
020import java.io.FileNotFoundException;
021import java.io.IOException;
022import java.io.InputStream;
023import java.io.Serializable;
024
025/**
026 * Empty FormFile instance, used to clear out FormFile attributes of Struts forms.
027 * 
028 * 
029 */
030public class BlankFormFile implements FormFile, Serializable {
031    public void destroy() {
032    }
033
034    public String getContentType() {
035        throw new UnsupportedOperationException();
036    }
037
038    public byte[] getFileData() throws FileNotFoundException, IOException {
039        throw new UnsupportedOperationException();
040    }
041
042    public String getFileName() {
043        return "";
044    }
045
046    public int getFileSize() {
047        return 0;
048    }
049
050    public InputStream getInputStream() throws FileNotFoundException, IOException {
051        throw new UnsupportedOperationException();
052    }
053
054    public void setContentType(String contentType) {
055        throw new UnsupportedOperationException();
056    }
057
058    public void setFileName(String fileName) {
059        throw new UnsupportedOperationException();
060    }
061
062    public void setFileSize(int fileSize) {
063        throw new UnsupportedOperationException();
064    }
065}