1 /** 2 * Copyright 2005-2016 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.krad.file; 17 18 import org.springframework.web.multipart.MultipartFile; 19 20 import java.util.Date; 21 22 /** 23 * The file object interface used by the MultiFileUpload component(s), these component(s) expect objects which 24 * implement this interface. 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 public interface FileMeta { 29 /** 30 * Init method called to initialize the FileMeta object 31 * 32 * @param multipartFile the file this object contains or represents 33 * @throws Exception 34 */ 35 public void init(MultipartFile multipartFile) throws Exception; 36 37 /** 38 * Unique id of the FileMeta object 39 * 40 * @return 41 */ 42 public String getId(); 43 44 /** 45 * @see #getId() 46 */ 47 public void setId(String id); 48 49 /** 50 * The name of the file 51 * 52 * @return 53 */ 54 public String getName(); 55 56 /** 57 * @see #getName() 58 */ 59 public void setName(String name); 60 61 /** 62 * The content type of the file 63 * 64 * @return 65 */ 66 public String getContentType(); 67 68 /** 69 * @see #getContentType() 70 */ 71 public void setContentType(String contentType); 72 73 /** 74 * The size of the file (in bytes) 75 * 76 * @return 77 */ 78 public Long getSize(); 79 80 /** 81 * @see #getSize() 82 */ 83 public void setSize(Long size); 84 85 /** 86 * The size of the file formatted into a more readable format 87 * 88 * @return 89 */ 90 public String getSizeFormatted(); 91 92 /** 93 * The date the file was uploaded 94 * 95 * @return 96 */ 97 public Date getDateUploaded(); 98 99 /** 100 * @see #getDateUploaded() 101 */ 102 public void setDateUploaded(Date dateUploaded); 103 104 /** 105 * The file uploaded date formatted ina more readable String format 106 * 107 * @return 108 */ 109 public String getDateUploadedFormatted(); 110 111 /** 112 * The url to use to download the file 113 * 114 * @return the url of the file download 115 */ 116 public String getUrl(); 117 118 /** 119 * @see #getUrl() 120 */ 121 public void setUrl(String url); 122 123 }