/* Copyright (c) 2011 Danish Maritime Authority * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ package dk.dma.ais.downloader; import java.util.Date; /** * Represents a file in the repository */ public class RepoFile implements Comparable<RepoFile> { String name; String path; Date updated; Long size; boolean complete; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } public Long getSize() { return size; } public void setSize(Long size) { this.size = size; } public boolean isComplete() { return complete; } public void setComplete(boolean complete) { this.complete = complete; } @Override public int compareTo(RepoFile o) { if (updated == null && o.updated == null) { return 0; } else if (updated == null) { return -1; } else if (o.updated == null) { return 1; } return updated.compareTo(o.updated); } }