From ddb132af1e6aba5cfa2f9c5d0204156b0627a67c Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Thu, 9 Oct 2014 14:48:37 +0200 Subject: Added type of operating system from db to DbImage. --- src/main/java/org/openslx/satellitedaemon/db/DbImage.java | 12 +++++++++--- .../satellitedaemon/filetransfer/FileUploadWorker.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java index 03ad078..35cff33 100644 --- a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java +++ b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java @@ -17,13 +17,16 @@ public class DbImage public final long fileSize; public final long changeTime; public final long createTime; + public final String contentOperatingSystem; public enum Status { only_local, to_be_published, being_published, successfully_published, to_be_decentralized, being_decentralized, successfully_decentralized } - public DbImage(String guid, String name, Integer rid, String path, String creator, Long fileSize, Long createTime, Long changeTime) + public DbImage( + String guid, String name, Integer rid, String path, String creator, + Long fileSize, Long createTime, Long changeTime, String contentOperatingSystem) { if ( rid == null ) rid = -1; @@ -37,6 +40,7 @@ public class DbImage this.fileSize = fileSize; this.createTime = createTime; this.changeTime = changeTime; + this.contentOperatingSystem = contentOperatingSystem; } /** @@ -49,7 +53,8 @@ public class DbImage public static List getAllMarkedForUpload() { return MySQL.findAll( DbImage.class, "SELECT image.GUID_imageID, image.image_name, image.imageVersion, image.image_path," + - " user.loginName AS userID, image.image_filesize, UNIX_TIMESTAMP(image.rec_create_time), UNIX_TIMESTAMP(image.rec_change_time)" + + " user.loginName AS userID, image.image_filesize, UNIX_TIMESTAMP(image.rec_create_time), UNIX_TIMESTAMP(image.rec_change_time)," + + " image.content_operatingSystem" + " FROM m_VLData_imageInfo image" + " INNER JOIN m_user user ON (image.image_owner = user.userID)" + " INNER JOIN m_institution institution ON (institution.institutionID = user.institution)" + @@ -67,7 +72,8 @@ public class DbImage public static List getAllMarkedForDownload() { return MySQL.findAll( DbImage.class, "SELECT image.GUID_imageID, image.image_name, image.imageVersion, image.image_path," + - " user.loginName AS userID, image.image_filesize, UNIX_TIMESTAMP(image.rec_create_time), UNIX_TIMESTAMP(image.rec_change_time)" + + " user.loginName AS userID, image.image_filesize, UNIX_TIMESTAMP(image.rec_create_time), UNIX_TIMESTAMP(image.rec_change_time)," + + " image.content_operatingSystem" + " FROM m_VLData_imageInfo image" + " INNER JOIN m_user user ON (image.image_owner = user.userID)" + " INNER JOIN m_institution institution ON (institution.institutionID = user.institution)" + diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java index 1034dd7..7f89146 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java @@ -32,7 +32,7 @@ public class FileUploadWorker implements Runnable ImageData imDat = new ImageData( image.guid, image.rid, image.name, image.createTime, image.changeTime, image.creator, - "anyThing", true, false, "best", image.fileSize ); + image.contentOperatingSystem, true, false, "best", image.fileSize ); String path = Globals.getImageFolder() + "/" + image.path; -- cgit v1.2.3-55-g7522