001/* 002 * #%L 003 * GwtMaterial 004 * %% 005 * Copyright (C) 2015 - 2017 GwtMaterialDesign 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package gwt.material.design.addins.client.fileuploader.base; 021 022import java.io.Serializable; 023import java.util.Date; 024 025/** 026 * An object that wraps all file information 027 * during the upload process 028 */ 029public class UploadFile implements Serializable { 030 031 private String name; 032 private Date lastModified; 033 private double fileSize; 034 private String type; 035 036 public UploadFile() { 037 } 038 039 public UploadFile(String name, Date lastModified, double fileSize, String type) { 040 this.name = name; 041 this.lastModified = lastModified; 042 this.fileSize = fileSize; 043 this.type = type; 044 } 045 046 public String getName() { 047 return name; 048 } 049 050 public void setName(String name) { 051 this.name = name; 052 } 053 054 public Date getLastModified() { 055 return lastModified; 056 } 057 058 public void setLastModified(Date lastModified) { 059 this.lastModified = lastModified; 060 } 061 062 public double getFileSize() { 063 double kb = fileSize / 1024; 064 return kb / 1024; 065 } 066 067 public void setFileSize(double fileSize) { 068 this.fileSize = fileSize; 069 } 070 071 public String getType() { 072 return type; 073 } 074 075 public void setType(String type) { 076 this.type = type; 077 } 078}