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