diff options
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java')
-rw-r--r-- | src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java b/src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java index 06ad5b1..dc15dae 100644 --- a/src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java +++ b/src/main/java/org/openslx/imagemaster/serverconnection/UploadingImage.java @@ -1,7 +1,5 @@ package org.openslx.imagemaster.serverconnection; -import java.sql.Timestamp; - import org.apache.log4j.Logger; import org.openslx.imagemaster.Globals; import org.openslx.imagemaster.crcchecker.CRCFile; @@ -29,17 +27,17 @@ public class UploadingImage private int[] blockStatus = null; public static final int valid = 200; public static final int missing = 0; - private Timestamp ts; // when did the server something for the last time + private long timestamp; // when did the server something for the last time private DbImage dbImage = null; // the DB representation of this image private String uuid; private String filename; private ImageFile imageFile; private CRCFile crcFile = null; - protected UploadingImage(String token, int[] initialBlockStatus, Timestamp ts, String uuid, String filename) + protected UploadingImage(String token, int[] initialBlockStatus, long timestamp, String uuid, String filename) { this.token = token; - this.ts = ts; + this.timestamp = timestamp; this.uuid = uuid; this.blockStatus = initialBlockStatus; } @@ -79,6 +77,11 @@ public class UploadingImage blockStatus[index] += ( blockStatus[index] < missing ) ? -1 : 1; // increase in both directions } + protected int getTimesTransmitted( int index ) + { + return Math.abs( blockStatus[index] ); + } + protected String getToken() { return this.token; @@ -103,9 +106,9 @@ public class UploadingImage return blockStatus.length; } - protected Timestamp getTimestamp() + protected long getTimestamp() { - return this.ts; + return this.timestamp; } protected DbImage getDbImage() @@ -116,16 +119,6 @@ public class UploadingImage return this.dbImage; } - // protected String getFilename() - // { - // return this.filename; - // } - // - // protected String getCrcFilename() - // { - // return this.crcFilename; - // } - protected ImageFile getImageFile() { if ( imageFile == null ) { |