{"action":"created","comment":{"url":"https://api.github.com/repos/terrestris/shogun2/pulls/comments/51127221","id":51127221,"diff_hunk":"@@ -0,0 +1,142 @@\n+/**\n+ *\n+ */\n+package de.terrestris.shogun2.model;\n+\n+import javax.persistence.Column;\n+import javax.persistence.Entity;\n+import javax.persistence.Table;\n+\n+import org.apache.commons.lang3.builder.EqualsBuilder;\n+import org.apache.commons.lang3.builder.HashCodeBuilder;\n+import org.apache.commons.lang3.builder.ToStringBuilder;\n+import org.apache.commons.lang3.builder.ToStringStyle;\n+\n+import com.fasterxml.jackson.annotation.JsonIgnore;\n+\n+/**\n+ * This class represents an Image which is stored as a bytearray in the database\n+ *\n+ * @author Johannes Weskamm\n+ * @author Daniel Koch\n+ *\n+ */\n+@Entity\n+@Table\n+public class Image extends File {\n+\n+\t/**\n+\t *\n+\t */\n+\tprivate static final long serialVersionUID = 1L;\n+\n+\t/**\n+\t *\n+\t */\n+\t@JsonIgnore\n+\t@Column(length = Integer.MAX_VALUE)\n+\tprivate byte[] thumbnail;\n+\n+\t/**\n+\t *\n+\t */\n+\tprivate Integer width;\n+\n+\t/**\n+\t *\n+\t */\n+\tprivate Integer height;\n+\n+\t/**\n+\t * @return the thumbnail\n+\t */\n+\tpublic byte[] getThumbnail() {\n+\t\treturn thumbnail;\n+\t}\n+\n+\t/**\n+\t * @param thumbnail the thumbnail to set\n+\t */\n+\tpublic void setThumbnail(byte[] thumbnail) {\n+\t\tthis.thumbnail = thumbnail;\n+\t}\n+\n+\t/**\n+\t * @return the width\n+\t */\n+\tpublic Integer getWidth() {\n+\t\treturn width;\n+\t}\n+\n+\t/**\n+\t * @param width the width to set\n+\t */\n+\tpublic void setWidth(Integer width) {\n+\t\tthis.width = width;\n+\t}\n+\n+\t/**\n+\t * @return the height\n+\t */\n+\tpublic Integer getHeight() {\n+\t\treturn height;\n+\t}\n+\n+\t/**\n+\t * @param height the height to set\n+\t */\n+\tpublic void setHeight(Integer height) {\n+\t\tthis.height = height;\n+\t}\n+\n+\t/**\n+\t * @see java.lang.Object#hashCode()\n+\t *\n+\t *      According to\n+\t *      http://stackoverflow.com/questions/27581/overriding-equals\n+\t *      -and-hashcode-in-java it is recommended only to use getter-methods\n+\t *      when using ORM like Hibernate\n+\t */\n+\t@Override\n+\tpublic int hashCode() {\n+\t\t// two randomly chosen prime numbers\n+\t\treturn new HashCodeBuilder(499, 269).appendSuper(super.hashCode())\n+\t\t\t\t.append(getActive())\n+\t\t\t\t.append(getFileName())\n+\t\t\t\t.append(getFileType())\n+\t\t\t\t.append(getWidth())\n+\t\t\t\t.append(getHeight())\n+\t\t\t\t.toHashCode();","path":"src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/Image.java","position":109,"original_position":109,"commit_id":"9ac104c9fa293c9c1303f5829cf4465e87542444","original_commit_id":"9ac104c9fa293c9c1303f5829cf4465e87542444","user":{"login":"dnlkoch","id":1137620,"avatar_url":"https://avatars.githubusercontent.com/u/1137620?v=3","gravatar_id":"","url":"https://api.github.com/users/dnlkoch","html_url":"https://github.com/dnlkoch","followers_url":"https://api.github.com/users/dnlkoch/followers","following_url":"https://api.github.com/users/dnlkoch/following{/other_user}","gists_url":"https://api.github.com/users/dnlkoch/gists{/gist_id}","starred_url":"https://api.github.com/users/dnlkoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnlkoch/subscriptions","organizations_url":"https://api.github.com/users/dnlkoch/orgs","repos_url":"https://api.github.com/users/dnlkoch/repos","events_url":"https://api.github.com/users/dnlkoch/events{/privacy}","received_events_url":"https://api.github.com/users/dnlkoch/received_events","type":"User","site_admin":false},"body":"Appender for `getActive()`, `getFileName()` and `getFileType()` not needed in this subclass.","created_at":"2016-01-28T14:19:59Z","updated_at":"2016-01-28T14:19:59Z","html_url":"https://github.com/terrestris/shogun2/pull/129#discussion_r51127221","pull_request_url":"https://api.github.com/repos/terrestris/shogun2/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/comments/51127221"},"html":{"href":"https://github.com/terrestris/shogun2/pull/129#discussion_r51127221"},"pull_request":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/terrestris/shogun2/pulls/129","id":57504987,"html_url":"https://github.com/terrestris/shogun2/pull/129","diff_url":"https://github.com/terrestris/shogun2/pull/129.diff","patch_url":"https://github.com/terrestris/shogun2/pull/129.patch","issue_url":"https://api.github.com/repos/terrestris/shogun2/issues/129","number":129,"state":"open","locked":false,"title":"Added generic fileupload and extending imageupload","user":{"login":"weskamm","id":1381363,"avatar_url":"https://avatars.githubusercontent.com/u/1381363?v=3","gravatar_id":"","url":"https://api.github.com/users/weskamm","html_url":"https://github.com/weskamm","followers_url":"https://api.github.com/users/weskamm/followers","following_url":"https://api.github.com/users/weskamm/following{/other_user}","gists_url":"https://api.github.com/users/weskamm/gists{/gist_id}","starred_url":"https://api.github.com/users/weskamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weskamm/subscriptions","organizations_url":"https://api.github.com/users/weskamm/orgs","repos_url":"https://api.github.com/users/weskamm/repos","events_url":"https://api.github.com/users/weskamm/events{/privacy}","received_events_url":"https://api.github.com/users/weskamm/received_events","type":"User","site_admin":false},"body":"This PR adds DAO, Model, Service and Controller for a generic fileupload.\r\nThe same goes for the Image.class, which extends from File.class.\r\nThe columns used for fileuploads uses the `byte[]` type and has the columnlength set to a maximum of round about 2GB.\r\nThis has been tested on PostgreSQL and H2 databases.\r\nTests are still missing and will follow..","created_at":"2016-01-28T13:56:45Z","updated_at":"2016-01-28T14:19:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f22852914f8927bcbc709b9ca4efb5f599142b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/terrestris/shogun2/pulls/129/commits","review_comments_url":"https://api.github.com/repos/terrestris/shogun2/pulls/129/comments","review_comment_url":"https://api.github.com/repos/terrestris/shogun2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terrestris/shogun2/issues/129/comments","statuses_url":"https://api.github.com/repos/terrestris/shogun2/statuses/9ac104c9fa293c9c1303f5829cf4465e87542444","head":{"label":"weskamm:genericupload","ref":"genericupload","sha":"9ac104c9fa293c9c1303f5829cf4465e87542444","user":{"login":"weskamm","id":1381363,"avatar_url":"https://avatars.githubusercontent.com/u/1381363?v=3","gravatar_id":"","url":"https://api.github.com/users/weskamm","html_url":"https://github.com/weskamm","followers_url":"https://api.github.com/users/weskamm/followers","following_url":"https://api.github.com/users/weskamm/following{/other_user}","gists_url":"https://api.github.com/users/weskamm/gists{/gist_id}","starred_url":"https://api.github.com/users/weskamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weskamm/subscriptions","organizations_url":"https://api.github.com/users/weskamm/orgs","repos_url":"https://api.github.com/users/weskamm/repos","events_url":"https://api.github.com/users/weskamm/events{/privacy}","received_events_url":"https://api.github.com/users/weskamm/received_events","type":"User","site_admin":false},"repo":{"id":45523637,"name":"shogun2","full_name":"weskamm/shogun2","owner":{"login":"weskamm","id":1381363,"avatar_url":"https://avatars.githubusercontent.com/u/1381363?v=3","gravatar_id":"","url":"https://api.github.com/users/weskamm","html_url":"https://github.com/weskamm","followers_url":"https://api.github.com/users/weskamm/followers","following_url":"https://api.github.com/users/weskamm/following{/other_user}","gists_url":"https://api.github.com/users/weskamm/gists{/gist_id}","starred_url":"https://api.github.com/users/weskamm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weskamm/subscriptions","organizations_url":"https://api.github.com/users/weskamm/orgs","repos_url":"https://api.github.com/users/weskamm/repos","events_url":"https://api.github.com/users/weskamm/events{/privacy}","received_events_url":"https://api.github.com/users/weskamm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weskamm/shogun2","description":"SHOGun2 is a Java based WebGIS framework.","fork":true,"url":"https://api.github.com/repos/weskamm/shogun2","forks_url":"https://api.github.com/repos/weskamm/shogun2/forks","keys_url":"https://api.github.com/repos/weskamm/shogun2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weskamm/shogun2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weskamm/shogun2/teams","hooks_url":"https://api.github.com/repos/weskamm/shogun2/hooks","issue_events_url":"https://api.github.com/repos/weskamm/shogun2/issues/events{/number}","events_url":"https://api.github.com/repos/weskamm/shogun2/events","assignees_url":"https://api.github.com/repos/weskamm/shogun2/assignees{/user}","branches_url":"https://api.github.com/repos/weskamm/shogun2/branches{/branch}","tags_url":"https://api.github.com/repos/weskamm/shogun2/tags","blobs_url":"https://api.github.com/repos/weskamm/shogun2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weskamm/shogun2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weskamm/shogun2/git/refs{/sha}","trees_url":"https://api.github.com/repos/weskamm/shogun2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weskamm/shogun2/statuses/{sha}","languages_url":"https://api.github.com/repos/weskamm/shogun2/languages","stargazers_url":"https://api.github.com/repos/weskamm/shogun2/stargazers","contributors_url":"https://api.github.com/repos/weskamm/shogun2/contributors","subscribers_url":"https://api.github.com/repos/weskamm/shogun2/subscribers","subscription_url":"https://api.github.com/repos/weskamm/shogun2/subscription","commits_url":"https://api.github.com/repos/weskamm/shogun2/commits{/sha}","git_commits_url":"https://api.github.com/repos/weskamm/shogun2/git/commits{/sha}","comments_url":"https://api.github.com/repos/weskamm/shogun2/comments{/number}","issue_comment_url":"https://api.github.com/repos/weskamm/shogun2/issues/comments{/number}","contents_url":"https://api.github.com/repos/weskamm/shogun2/contents/{+path}","compare_url":"https://api.github.com/repos/weskamm/shogun2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weskamm/shogun2/merges","archive_url":"https://api.github.com/repos/weskamm/shogun2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weskamm/shogun2/downloads","issues_url":"https://api.github.com/repos/weskamm/shogun2/issues{/number}","pulls_url":"https://api.github.com/repos/weskamm/shogun2/pulls{/number}","milestones_url":"https://api.github.com/repos/weskamm/shogun2/milestones{/number}","notifications_url":"https://api.github.com/repos/weskamm/shogun2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weskamm/shogun2/labels{/name}","releases_url":"https://api.github.com/repos/weskamm/shogun2/releases{/id}","deployments_url":"https://api.github.com/repos/weskamm/shogun2/deployments","created_at":"2015-11-04T07:55:03Z","updated_at":"2016-01-26T09:28:39Z","pushed_at":"2016-01-28T10:26:30Z","git_url":"git://github.com/weskamm/shogun2.git","ssh_url":"git@github.com:weskamm/shogun2.git","clone_url":"https://github.com/weskamm/shogun2.git","svn_url":"https://github.com/weskamm/shogun2","homepage":null,"size":942,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"terrestris:master","ref":"master","sha":"86e43fa43250b4a61ea122b249b4127c29e87969","user":{"login":"terrestris","id":1510416,"avatar_url":"https://avatars.githubusercontent.com/u/1510416?v=3","gravatar_id":"","url":"https://api.github.com/users/terrestris","html_url":"https://github.com/terrestris","followers_url":"https://api.github.com/users/terrestris/followers","following_url":"https://api.github.com/users/terrestris/following{/other_user}","gists_url":"https://api.github.com/users/terrestris/gists{/gist_id}","starred_url":"https://api.github.com/users/terrestris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrestris/subscriptions","organizations_url":"https://api.github.com/users/terrestris/orgs","repos_url":"https://api.github.com/users/terrestris/repos","events_url":"https://api.github.com/users/terrestris/events{/privacy}","received_events_url":"https://api.github.com/users/terrestris/received_events","type":"Organization","site_admin":false},"repo":{"id":15997656,"name":"shogun2","full_name":"terrestris/shogun2","owner":{"login":"terrestris","id":1510416,"avatar_url":"https://avatars.githubusercontent.com/u/1510416?v=3","gravatar_id":"","url":"https://api.github.com/users/terrestris","html_url":"https://github.com/terrestris","followers_url":"https://api.github.com/users/terrestris/followers","following_url":"https://api.github.com/users/terrestris/following{/other_user}","gists_url":"https://api.github.com/users/terrestris/gists{/gist_id}","starred_url":"https://api.github.com/users/terrestris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrestris/subscriptions","organizations_url":"https://api.github.com/users/terrestris/orgs","repos_url":"https://api.github.com/users/terrestris/repos","events_url":"https://api.github.com/users/terrestris/events{/privacy}","received_events_url":"https://api.github.com/users/terrestris/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/terrestris/shogun2","description":"SHOGun2 is a Java based WebGIS framework.","fork":false,"url":"https://api.github.com/repos/terrestris/shogun2","forks_url":"https://api.github.com/repos/terrestris/shogun2/forks","keys_url":"https://api.github.com/repos/terrestris/shogun2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terrestris/shogun2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terrestris/shogun2/teams","hooks_url":"https://api.github.com/repos/terrestris/shogun2/hooks","issue_events_url":"https://api.github.com/repos/terrestris/shogun2/issues/events{/number}","events_url":"https://api.github.com/repos/terrestris/shogun2/events","assignees_url":"https://api.github.com/repos/terrestris/shogun2/assignees{/user}","branches_url":"https://api.github.com/repos/terrestris/shogun2/branches{/branch}","tags_url":"https://api.github.com/repos/terrestris/shogun2/tags","blobs_url":"https://api.github.com/repos/terrestris/shogun2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terrestris/shogun2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terrestris/shogun2/git/refs{/sha}","trees_url":"https://api.github.com/repos/terrestris/shogun2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terrestris/shogun2/statuses/{sha}","languages_url":"https://api.github.com/repos/terrestris/shogun2/languages","stargazers_url":"https://api.github.com/repos/terrestris/shogun2/stargazers","contributors_url":"https://api.github.com/repos/terrestris/shogun2/contributors","subscribers_url":"https://api.github.com/repos/terrestris/shogun2/subscribers","subscription_url":"https://api.github.com/repos/terrestris/shogun2/subscription","commits_url":"https://api.github.com/repos/terrestris/shogun2/commits{/sha}","git_commits_url":"https://api.github.com/repos/terrestris/shogun2/git/commits{/sha}","comments_url":"https://api.github.com/repos/terrestris/shogun2/comments{/number}","issue_comment_url":"https://api.github.com/repos/terrestris/shogun2/issues/comments{/number}","contents_url":"https://api.github.com/repos/terrestris/shogun2/contents/{+path}","compare_url":"https://api.github.com/repos/terrestris/shogun2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terrestris/shogun2/merges","archive_url":"https://api.github.com/repos/terrestris/shogun2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terrestris/shogun2/downloads","issues_url":"https://api.github.com/repos/terrestris/shogun2/issues{/number}","pulls_url":"https://api.github.com/repos/terrestris/shogun2/pulls{/number}","milestones_url":"https://api.github.com/repos/terrestris/shogun2/milestones{/number}","notifications_url":"https://api.github.com/repos/terrestris/shogun2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terrestris/shogun2/labels{/name}","releases_url":"https://api.github.com/repos/terrestris/shogun2/releases{/id}","deployments_url":"https://api.github.com/repos/terrestris/shogun2/deployments","created_at":"2014-01-17T11:10:10Z","updated_at":"2016-01-11T09:10:54Z","pushed_at":"2016-01-28T13:56:45Z","git_url":"git://github.com/terrestris/shogun2.git","ssh_url":"git@github.com:terrestris/shogun2.git","clone_url":"https://github.com/terrestris/shogun2.git","svn_url":"https://github.com/terrestris/shogun2","homepage":null,"size":960,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":4,"forks":10,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/129"},"html":{"href":"https://github.com/terrestris/shogun2/pull/129"},"issue":{"href":"https://api.github.com/repos/terrestris/shogun2/issues/129"},"comments":{"href":"https://api.github.com/repos/terrestris/shogun2/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terrestris/shogun2/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/terrestris/shogun2/statuses/9ac104c9fa293c9c1303f5829cf4465e87542444"}}}}