{"action":"created","comment":{"url":"https://api.github.com/repos/hierynomus/smbj/pulls/comments/92200213","pull_request_review_id":12711167,"id":92200213,"diff_hunk":"@@ -0,0 +1,108 @@\n+/*\r\n+ * Copyright (C)2016 - SMBJ Contributors\r\n+ *\r\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n+ * you may not use this file except in compliance with the License.\r\n+ * You may obtain a copy of the License at\r\n+ *\r\n+ *     http://www.apache.org/licenses/LICENSE-2.0\r\n+ *\r\n+ * Unless required by applicable law or agreed to in writing, software\r\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n+ * See the License for the specific language governing permissions and\r\n+ * limitations under the License.\r\n+ */\r\n+\r\n+package com.hierynomus.msfscc.fileinformation;\r\n+\r\n+import java.math.BigInteger;\r\n+\r\n+import com.hierynomus.protocol.commons.buffer.Buffer;\r\n+import com.hierynomus.protocol.commons.buffer.Buffer.BufferException;\r\n+\r\n+public class ShareInfo {\r\n+\r\n+\tprivate final long totalAllocationUnits;\r\n+\tprivate final long callerAvailableAllocationUnits;\r\n+\tprivate final long actualAvailableAllocationUnits;\r\n+\tprivate final int sectorsPerAllocationUnit;\r\n+\tprivate final int bytesPerSector;\r\n+\t\r\n+\tprivate final long totalSpace;\r\n+\tprivate final long callerFreeSpace;\r\n+\tprivate final long actualFreeSpace;\r\n+\t\r\n+\tprivate final static BigInteger MAX_VALUE = BigInteger.valueOf(Long.MAX_VALUE);\r\n+\t\r\n+\tShareInfo(long totalAllocationUnits, long callerAvailableAllocationUnits,\r\n+\t\t\tlong actualAvailableAllocationUnits, int sectorsPerAllocationUnit, int bytesPerSector) {\r\n+\t\tthis.totalAllocationUnits = totalAllocationUnits;\r\n+\t\tthis.callerAvailableAllocationUnits = callerAvailableAllocationUnits;\r\n+\t\tthis.actualAvailableAllocationUnits = actualAvailableAllocationUnits;\r\n+\t\tthis.sectorsPerAllocationUnit = sectorsPerAllocationUnit;\r\n+\t\tthis.bytesPerSector = bytesPerSector;\r\n+\r\n+\t\t// Using BigInteger to check for overflows...\r\n+\t\tBigInteger bytesPerAllocationUnit = BigInteger.valueOf(sectorsPerAllocationUnit).multiply(BigInteger.valueOf(bytesPerSector));\r\n+\t\tassert bytesPerAllocationUnit.compareTo(MAX_VALUE) <= 0;\r","path":"src/main/java/com/hierynomus/msfscc/fileinformation/ShareInfo.java","position":null,"original_position":48,"commit_id":"5ec33599f91ea5adb6b727d1f4a378da6f589da5","original_commit_id":"68e933dab2c7d1d4fcaebc57dabd934dbbef9d1c","user":{"login":"niggemannmj","id":19157567,"avatar_url":"https://avatars.githubusercontent.com/u/19157567?v=3","gravatar_id":"","url":"https://api.github.com/users/niggemannmj","html_url":"https://github.com/niggemannmj","followers_url":"https://api.github.com/users/niggemannmj/followers","following_url":"https://api.github.com/users/niggemannmj/following{/other_user}","gists_url":"https://api.github.com/users/niggemannmj/gists{/gist_id}","starred_url":"https://api.github.com/users/niggemannmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niggemannmj/subscriptions","organizations_url":"https://api.github.com/users/niggemannmj/orgs","repos_url":"https://api.github.com/users/niggemannmj/repos","events_url":"https://api.github.com/users/niggemannmj/events{/privacy}","received_events_url":"https://api.github.com/users/niggemannmj/received_events","type":"User","site_admin":false},"body":"Removed assertions and BigInteger checks. ","created_at":"2016-12-13T16:02:26Z","updated_at":"2016-12-13T16:02:26Z","html_url":"https://github.com/hierynomus/smbj/pull/24#discussion_r92200213","pull_request_url":"https://api.github.com/repos/hierynomus/smbj/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/comments/92200213"},"html":{"href":"https://github.com/hierynomus/smbj/pull/24#discussion_r92200213"},"pull_request":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/hierynomus/smbj/pulls/24","id":85485540,"html_url":"https://github.com/hierynomus/smbj/pull/24","diff_url":"https://github.com/hierynomus/smbj/pull/24.diff","patch_url":"https://github.com/hierynomus/smbj/pull/24.patch","issue_url":"https://api.github.com/repos/hierynomus/smbj/issues/24","number":24,"state":"open","locked":false,"title":"Add ShareInfo to DiskShare and update ByteChunkProvider to allow for long offset","user":{"login":"niggemannmj","id":19157567,"avatar_url":"https://avatars.githubusercontent.com/u/19157567?v=3","gravatar_id":"","url":"https://api.github.com/users/niggemannmj","html_url":"https://github.com/niggemannmj","followers_url":"https://api.github.com/users/niggemannmj/followers","following_url":"https://api.github.com/users/niggemannmj/following{/other_user}","gists_url":"https://api.github.com/users/niggemannmj/gists{/gist_id}","starred_url":"https://api.github.com/users/niggemannmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niggemannmj/subscriptions","organizations_url":"https://api.github.com/users/niggemannmj/orgs","repos_url":"https://api.github.com/users/niggemannmj/repos","events_url":"https://api.github.com/users/niggemannmj/events{/privacy}","received_events_url":"https://api.github.com/users/niggemannmj/received_events","type":"User","site_admin":false},"body":"Added ShareInfo to return the FileFSFullSizeInformation and calculate the total space, free space for the caller and actual free space. Added this to the DiskShare as method getShareInformation.\n\nUpdated ByteChunkProvider to use long offset rather than int offset and to make the value protected to allow for arbitrary setting by a subclass.\n","created_at":"2016-09-15T21:40:39Z","updated_at":"2016-12-13T16:02:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4871079cd178568d04a5ce13b9b732880ced30bf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hierynomus/smbj/pulls/24/commits","review_comments_url":"https://api.github.com/repos/hierynomus/smbj/pulls/24/comments","review_comment_url":"https://api.github.com/repos/hierynomus/smbj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hierynomus/smbj/issues/24/comments","statuses_url":"https://api.github.com/repos/hierynomus/smbj/statuses/5ec33599f91ea5adb6b727d1f4a378da6f589da5","head":{"label":"niggemannmj:master","ref":"master","sha":"5ec33599f91ea5adb6b727d1f4a378da6f589da5","user":{"login":"niggemannmj","id":19157567,"avatar_url":"https://avatars.githubusercontent.com/u/19157567?v=3","gravatar_id":"","url":"https://api.github.com/users/niggemannmj","html_url":"https://github.com/niggemannmj","followers_url":"https://api.github.com/users/niggemannmj/followers","following_url":"https://api.github.com/users/niggemannmj/following{/other_user}","gists_url":"https://api.github.com/users/niggemannmj/gists{/gist_id}","starred_url":"https://api.github.com/users/niggemannmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niggemannmj/subscriptions","organizations_url":"https://api.github.com/users/niggemannmj/orgs","repos_url":"https://api.github.com/users/niggemannmj/repos","events_url":"https://api.github.com/users/niggemannmj/events{/privacy}","received_events_url":"https://api.github.com/users/niggemannmj/received_events","type":"User","site_admin":false},"repo":{"id":67712239,"name":"smbj","full_name":"niggemannmj/smbj","owner":{"login":"niggemannmj","id":19157567,"avatar_url":"https://avatars.githubusercontent.com/u/19157567?v=3","gravatar_id":"","url":"https://api.github.com/users/niggemannmj","html_url":"https://github.com/niggemannmj","followers_url":"https://api.github.com/users/niggemannmj/followers","following_url":"https://api.github.com/users/niggemannmj/following{/other_user}","gists_url":"https://api.github.com/users/niggemannmj/gists{/gist_id}","starred_url":"https://api.github.com/users/niggemannmj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niggemannmj/subscriptions","organizations_url":"https://api.github.com/users/niggemannmj/orgs","repos_url":"https://api.github.com/users/niggemannmj/repos","events_url":"https://api.github.com/users/niggemannmj/events{/privacy}","received_events_url":"https://api.github.com/users/niggemannmj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/niggemannmj/smbj","description":"Server Message Block (SMB2, SMB3) implementation in Java","fork":true,"url":"https://api.github.com/repos/niggemannmj/smbj","forks_url":"https://api.github.com/repos/niggemannmj/smbj/forks","keys_url":"https://api.github.com/repos/niggemannmj/smbj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niggemannmj/smbj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niggemannmj/smbj/teams","hooks_url":"https://api.github.com/repos/niggemannmj/smbj/hooks","issue_events_url":"https://api.github.com/repos/niggemannmj/smbj/issues/events{/number}","events_url":"https://api.github.com/repos/niggemannmj/smbj/events","assignees_url":"https://api.github.com/repos/niggemannmj/smbj/assignees{/user}","branches_url":"https://api.github.com/repos/niggemannmj/smbj/branches{/branch}","tags_url":"https://api.github.com/repos/niggemannmj/smbj/tags","blobs_url":"https://api.github.com/repos/niggemannmj/smbj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niggemannmj/smbj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niggemannmj/smbj/git/refs{/sha}","trees_url":"https://api.github.com/repos/niggemannmj/smbj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niggemannmj/smbj/statuses/{sha}","languages_url":"https://api.github.com/repos/niggemannmj/smbj/languages","stargazers_url":"https://api.github.com/repos/niggemannmj/smbj/stargazers","contributors_url":"https://api.github.com/repos/niggemannmj/smbj/contributors","subscribers_url":"https://api.github.com/repos/niggemannmj/smbj/subscribers","subscription_url":"https://api.github.com/repos/niggemannmj/smbj/subscription","commits_url":"https://api.github.com/repos/niggemannmj/smbj/commits{/sha}","git_commits_url":"https://api.github.com/repos/niggemannmj/smbj/git/commits{/sha}","comments_url":"https://api.github.com/repos/niggemannmj/smbj/comments{/number}","issue_comment_url":"https://api.github.com/repos/niggemannmj/smbj/issues/comments{/number}","contents_url":"https://api.github.com/repos/niggemannmj/smbj/contents/{+path}","compare_url":"https://api.github.com/repos/niggemannmj/smbj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niggemannmj/smbj/merges","archive_url":"https://api.github.com/repos/niggemannmj/smbj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niggemannmj/smbj/downloads","issues_url":"https://api.github.com/repos/niggemannmj/smbj/issues{/number}","pulls_url":"https://api.github.com/repos/niggemannmj/smbj/pulls{/number}","milestones_url":"https://api.github.com/repos/niggemannmj/smbj/milestones{/number}","notifications_url":"https://api.github.com/repos/niggemannmj/smbj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niggemannmj/smbj/labels{/name}","releases_url":"https://api.github.com/repos/niggemannmj/smbj/releases{/id}","deployments_url":"https://api.github.com/repos/niggemannmj/smbj/deployments","created_at":"2016-09-08T14:49:20Z","updated_at":"2016-09-08T14:49:22Z","pushed_at":"2016-12-13T15:58:07Z","git_url":"git://github.com/niggemannmj/smbj.git","ssh_url":"git@github.com:niggemannmj/smbj.git","clone_url":"https://github.com/niggemannmj/smbj.git","svn_url":"https://github.com/niggemannmj/smbj","homepage":null,"size":8450,"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":"hierynomus:master","ref":"master","sha":"fa624df3de518f1a6d04858b475386ebf2b82225","user":{"login":"hierynomus","id":117667,"avatar_url":"https://avatars.githubusercontent.com/u/117667?v=3","gravatar_id":"","url":"https://api.github.com/users/hierynomus","html_url":"https://github.com/hierynomus","followers_url":"https://api.github.com/users/hierynomus/followers","following_url":"https://api.github.com/users/hierynomus/following{/other_user}","gists_url":"https://api.github.com/users/hierynomus/gists{/gist_id}","starred_url":"https://api.github.com/users/hierynomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hierynomus/subscriptions","organizations_url":"https://api.github.com/users/hierynomus/orgs","repos_url":"https://api.github.com/users/hierynomus/repos","events_url":"https://api.github.com/users/hierynomus/events{/privacy}","received_events_url":"https://api.github.com/users/hierynomus/received_events","type":"User","site_admin":false},"repo":{"id":50351931,"name":"smbj","full_name":"hierynomus/smbj","owner":{"login":"hierynomus","id":117667,"avatar_url":"https://avatars.githubusercontent.com/u/117667?v=3","gravatar_id":"","url":"https://api.github.com/users/hierynomus","html_url":"https://github.com/hierynomus","followers_url":"https://api.github.com/users/hierynomus/followers","following_url":"https://api.github.com/users/hierynomus/following{/other_user}","gists_url":"https://api.github.com/users/hierynomus/gists{/gist_id}","starred_url":"https://api.github.com/users/hierynomus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hierynomus/subscriptions","organizations_url":"https://api.github.com/users/hierynomus/orgs","repos_url":"https://api.github.com/users/hierynomus/repos","events_url":"https://api.github.com/users/hierynomus/events{/privacy}","received_events_url":"https://api.github.com/users/hierynomus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hierynomus/smbj","description":"Server Message Block (SMB2, SMB3) implementation in Java","fork":false,"url":"https://api.github.com/repos/hierynomus/smbj","forks_url":"https://api.github.com/repos/hierynomus/smbj/forks","keys_url":"https://api.github.com/repos/hierynomus/smbj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hierynomus/smbj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hierynomus/smbj/teams","hooks_url":"https://api.github.com/repos/hierynomus/smbj/hooks","issue_events_url":"https://api.github.com/repos/hierynomus/smbj/issues/events{/number}","events_url":"https://api.github.com/repos/hierynomus/smbj/events","assignees_url":"https://api.github.com/repos/hierynomus/smbj/assignees{/user}","branches_url":"https://api.github.com/repos/hierynomus/smbj/branches{/branch}","tags_url":"https://api.github.com/repos/hierynomus/smbj/tags","blobs_url":"https://api.github.com/repos/hierynomus/smbj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hierynomus/smbj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hierynomus/smbj/git/refs{/sha}","trees_url":"https://api.github.com/repos/hierynomus/smbj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hierynomus/smbj/statuses/{sha}","languages_url":"https://api.github.com/repos/hierynomus/smbj/languages","stargazers_url":"https://api.github.com/repos/hierynomus/smbj/stargazers","contributors_url":"https://api.github.com/repos/hierynomus/smbj/contributors","subscribers_url":"https://api.github.com/repos/hierynomus/smbj/subscribers","subscription_url":"https://api.github.com/repos/hierynomus/smbj/subscription","commits_url":"https://api.github.com/repos/hierynomus/smbj/commits{/sha}","git_commits_url":"https://api.github.com/repos/hierynomus/smbj/git/commits{/sha}","comments_url":"https://api.github.com/repos/hierynomus/smbj/comments{/number}","issue_comment_url":"https://api.github.com/repos/hierynomus/smbj/issues/comments{/number}","contents_url":"https://api.github.com/repos/hierynomus/smbj/contents/{+path}","compare_url":"https://api.github.com/repos/hierynomus/smbj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hierynomus/smbj/merges","archive_url":"https://api.github.com/repos/hierynomus/smbj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hierynomus/smbj/downloads","issues_url":"https://api.github.com/repos/hierynomus/smbj/issues{/number}","pulls_url":"https://api.github.com/repos/hierynomus/smbj/pulls{/number}","milestones_url":"https://api.github.com/repos/hierynomus/smbj/milestones{/number}","notifications_url":"https://api.github.com/repos/hierynomus/smbj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hierynomus/smbj/labels{/name}","releases_url":"https://api.github.com/repos/hierynomus/smbj/releases{/id}","deployments_url":"https://api.github.com/repos/hierynomus/smbj/deployments","created_at":"2016-01-25T13:23:01Z","updated_at":"2016-11-07T06:25:27Z","pushed_at":"2016-12-13T15:58:08Z","git_url":"git://github.com/hierynomus/smbj.git","ssh_url":"git@github.com:hierynomus/smbj.git","clone_url":"https://github.com/hierynomus/smbj.git","svn_url":"https://github.com/hierynomus/smbj","homepage":null,"size":8539,"stargazers_count":6,"watchers_count":6,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":8,"forks":7,"open_issues":8,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/24"},"html":{"href":"https://github.com/hierynomus/smbj/pull/24"},"issue":{"href":"https://api.github.com/repos/hierynomus/smbj/issues/24"},"comments":{"href":"https://api.github.com/repos/hierynomus/smbj/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hierynomus/smbj/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/hierynomus/smbj/statuses/5ec33599f91ea5adb6b727d1f4a378da6f589da5"}}}}
{"actor":{"display_login":"niggemannmj"}}