{"action":"created","comment":{"url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/comments/87270188","pull_request_review_id":7888919,"id":87270188,"diff_hunk":"@@ -62,55 +68,120 @@ public CliCommand init(final Arguments args) throws Exception {\n         processCommandOptions(EMPTY_LIST, optionalArgs, args);\n \n         this.filterParams = args.getFilterParams();\n+        checkFilterParams();\n         this.bucketName = args.getBucket();\n \n-        // not supported in current version\n-        this.prefix = null;\n+        this.prefix = null; // doesn't work\n         return this;\n     }\n \n+    private boolean checkFilterParams() throws BadArgumentException {\n+        // if filter-params are specified, ascertain that all are supported\n+        if (Guard.isMapNullOrEmpty(this.filterParams)) {\n+            return true;\n+        }\n+        final ImmutableList<String> legalParams\n+                = ImmutableList.of(CONTAINS, OWNER, NEWERTHAN,  OLDERTHAN,  LARGERTHAN,  SMALLERTHAN);\n+        for (final String paramName : this.filterParams.keySet()) {\n+            if (!legalParams.contains(paramName)) {\n+                throw new BadArgumentException(\"Unknown filter parameter: \" + paramName);\n+            }\n+        }\n+        return true;\n+    }\n+\n     @Override\n     public GetDetailedObjectsResult call() throws Exception {\n \n-        final FluentIterable<DetailedS3Object> suspectBulkObjects;\n-        final Predicate<DetailedS3Object> filterPredicate = getPredicate();\n-\n-        // get filtered list using pagination\n-        suspectBulkObjects = FluentIterable.from(new LazyIterable<>(\n+        final FluentIterable<DetailedS3Object> detailedObjects = FluentIterable.from(new LazyIterable<>(\n                         new GetObjectsFullDetailsLoaderFactory(getClient(), this.bucketName, this.prefix, 100, 5, true)))\n-                .filter(Predicates.notNull());\n+                .filter(Predicates.and(getDatePredicate(), getSizePredicate(), getNamePredicate(), getOwnerPredicate()));\n+\n+        return new GetDetailedObjectsResult(detailedObjects);\n+    }\n \n-        if (filterPredicate != null) {\n-            return new GetDetailedObjectsResult(suspectBulkObjects.filter(filterPredicate));\n+    protected Predicate<DetailedS3Object> getSizePredicate() throws CommandException {\n+        if (Guard.isMapNullOrEmpty(this.filterParams)) {\n+            return Predicates.notNull();\n         }\n \n-        return new GetDetailedObjectsResult(suspectBulkObjects);\n-    }\n+        String larger = this.filterParams.get(LARGERTHAN);\n+        String smaller = this.filterParams.get(SMALLERTHAN);\n+        if (Guard.isStringNullOrEmpty(larger) && Guard.isStringNullOrEmpty(smaller)) {\n+            return Predicates.notNull();\n+        }\n+        // if one is specified, use default value for other\n+        final long largerthan = Guard.isStringNullOrEmpty(larger) ? 0L : Long.parseLong(larger);\n+        final long smallerthan = Guard.isStringNullOrEmpty(smaller) ? Long.MAX_VALUE : Long.parseLong(smaller);\n \n-    protected Predicate<DetailedS3Object> getPredicate() throws CommandException {\n+        return new Predicate<DetailedS3Object>() {\n+            @Override\n+            public boolean apply(@Nullable final DetailedS3Object input) {\n+                return input.getSize() > largerthan\n+                        && input.getSize() < smallerthan;\n+            }\n+        };\n+    }\n \n+    protected Predicate<DetailedS3Object> getDatePredicate() throws CommandException {\n         if (Guard.isMapNullOrEmpty(this.filterParams)) {\n-            return null;\n+            return Predicates.notNull();\n         }\n \n-        // else build a predicate from search-params\n-        final Map<String, String> ranges = parseMeta();\n-        final long largerthan = Long.parseLong(ranges.get(LARGERTHAN));\n-        final long smallerthan = Long.parseLong(ranges.get(SMALLERTHAN));\n-        final Date newerthan = new Date(Long.parseLong(ranges.get(NEWERTHAN)));\n-        final Date olderthan = new Date(Long.parseLong(ranges.get(OLDERTHAN)));\n+        String newer = this.filterParams.get(NEWERTHAN);\n+        String older = this.filterParams.get(OLDERTHAN);","path":"ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetDetailedObjects.java","position":118,"original_position":118,"commit_id":"345a4aa5a1353b2b0b12e60e46f31deec5b7f07b","original_commit_id":"345a4aa5a1353b2b0b12e60e46f31deec5b7f07b","user":{"login":"rpmoore","id":1901294,"avatar_url":"https://avatars.githubusercontent.com/u/1901294?v=3","gravatar_id":"","url":"https://api.github.com/users/rpmoore","html_url":"https://github.com/rpmoore","followers_url":"https://api.github.com/users/rpmoore/followers","following_url":"https://api.github.com/users/rpmoore/following{/other_user}","gists_url":"https://api.github.com/users/rpmoore/gists{/gist_id}","starred_url":"https://api.github.com/users/rpmoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpmoore/subscriptions","organizations_url":"https://api.github.com/users/rpmoore/orgs","repos_url":"https://api.github.com/users/rpmoore/repos","events_url":"https://api.github.com/users/rpmoore/events{/privacy}","received_events_url":"https://api.github.com/users/rpmoore/received_events","type":"User","site_admin":false},"body":"Missing final","created_at":"2016-11-09T20:23:02Z","updated_at":"2016-11-09T20:27:04Z","html_url":"https://github.com/SpectraLogic/ds3_java_cli/pull/146#discussion_r87270188","pull_request_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/comments/87270188"},"html":{"href":"https://github.com/SpectraLogic/ds3_java_cli/pull/146#discussion_r87270188"},"pull_request":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146","id":93030893,"html_url":"https://github.com/SpectraLogic/ds3_java_cli/pull/146","diff_url":"https://github.com/SpectraLogic/ds3_java_cli/pull/146.diff","patch_url":"https://github.com/SpectraLogic/ds3_java_cli/pull/146.patch","issue_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/146","number":146,"state":"open","locked":false,"title":"JAVACLI-130: Add more filter parameters to getDetailedObjects()","user":{"login":"berkeleysquare","id":13731823,"avatar_url":"https://avatars.githubusercontent.com/u/13731823?v=3","gravatar_id":"","url":"https://api.github.com/users/berkeleysquare","html_url":"https://github.com/berkeleysquare","followers_url":"https://api.github.com/users/berkeleysquare/followers","following_url":"https://api.github.com/users/berkeleysquare/following{/other_user}","gists_url":"https://api.github.com/users/berkeleysquare/gists{/gist_id}","starred_url":"https://api.github.com/users/berkeleysquare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkeleysquare/subscriptions","organizations_url":"https://api.github.com/users/berkeleysquare/orgs","repos_url":"https://api.github.com/users/berkeleysquare/repos","events_url":"https://api.github.com/users/berkeleysquare/events{/privacy}","received_events_url":"https://api.github.com/users/berkeleysquare/received_events","type":"User","site_admin":false},"body":"added owner, (Object name) contains to newerthan olderthan, largerthan, and smallerthan.","created_at":"2016-11-09T20:14:01Z","updated_at":"2016-11-09T20:27:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa67b717dfd2b929df387e6a61b2df235c8ecf23","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146/commits","review_comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146/comments","review_comment_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/146/comments","statuses_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/statuses/345a4aa5a1353b2b0b12e60e46f31deec5b7f07b","head":{"label":"berkeleysquare:cli130","ref":"cli130","sha":"345a4aa5a1353b2b0b12e60e46f31deec5b7f07b","user":{"login":"berkeleysquare","id":13731823,"avatar_url":"https://avatars.githubusercontent.com/u/13731823?v=3","gravatar_id":"","url":"https://api.github.com/users/berkeleysquare","html_url":"https://github.com/berkeleysquare","followers_url":"https://api.github.com/users/berkeleysquare/followers","following_url":"https://api.github.com/users/berkeleysquare/following{/other_user}","gists_url":"https://api.github.com/users/berkeleysquare/gists{/gist_id}","starred_url":"https://api.github.com/users/berkeleysquare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkeleysquare/subscriptions","organizations_url":"https://api.github.com/users/berkeleysquare/orgs","repos_url":"https://api.github.com/users/berkeleysquare/repos","events_url":"https://api.github.com/users/berkeleysquare/events{/privacy}","received_events_url":"https://api.github.com/users/berkeleysquare/received_events","type":"User","site_admin":false},"repo":{"id":56347543,"name":"ds3_java_cli","full_name":"berkeleysquare/ds3_java_cli","owner":{"login":"berkeleysquare","id":13731823,"avatar_url":"https://avatars.githubusercontent.com/u/13731823?v=3","gravatar_id":"","url":"https://api.github.com/users/berkeleysquare","html_url":"https://github.com/berkeleysquare","followers_url":"https://api.github.com/users/berkeleysquare/followers","following_url":"https://api.github.com/users/berkeleysquare/following{/other_user}","gists_url":"https://api.github.com/users/berkeleysquare/gists{/gist_id}","starred_url":"https://api.github.com/users/berkeleysquare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkeleysquare/subscriptions","organizations_url":"https://api.github.com/users/berkeleysquare/orgs","repos_url":"https://api.github.com/users/berkeleysquare/repos","events_url":"https://api.github.com/users/berkeleysquare/events{/privacy}","received_events_url":"https://api.github.com/users/berkeleysquare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berkeleysquare/ds3_java_cli","description":null,"fork":true,"url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli","forks_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/forks","keys_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/teams","hooks_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/hooks","issue_events_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/issues/events{/number}","events_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/events","assignees_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/assignees{/user}","branches_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/branches{/branch}","tags_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/tags","blobs_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/statuses/{sha}","languages_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/languages","stargazers_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/stargazers","contributors_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/contributors","subscribers_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/subscribers","subscription_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/subscription","commits_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/contents/{+path}","compare_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/merges","archive_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/downloads","issues_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/issues{/number}","pulls_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/pulls{/number}","milestones_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/milestones{/number}","notifications_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/labels{/name}","releases_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/releases{/id}","deployments_url":"https://api.github.com/repos/berkeleysquare/ds3_java_cli/deployments","created_at":"2016-04-15T20:22:12Z","updated_at":"2016-04-15T20:22:13Z","pushed_at":"2016-11-09T20:12:06Z","git_url":"git://github.com/berkeleysquare/ds3_java_cli.git","ssh_url":"git@github.com:berkeleysquare/ds3_java_cli.git","clone_url":"https://github.com/berkeleysquare/ds3_java_cli.git","svn_url":"https://github.com/berkeleysquare/ds3_java_cli","homepage":null,"size":2686,"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":"SpectraLogic:master","ref":"master","sha":"1a726653452067dad261bf5043f0682aeadda925","user":{"login":"SpectraLogic","id":7060807,"avatar_url":"https://avatars.githubusercontent.com/u/7060807?v=3","gravatar_id":"","url":"https://api.github.com/users/SpectraLogic","html_url":"https://github.com/SpectraLogic","followers_url":"https://api.github.com/users/SpectraLogic/followers","following_url":"https://api.github.com/users/SpectraLogic/following{/other_user}","gists_url":"https://api.github.com/users/SpectraLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/SpectraLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpectraLogic/subscriptions","organizations_url":"https://api.github.com/users/SpectraLogic/orgs","repos_url":"https://api.github.com/users/SpectraLogic/repos","events_url":"https://api.github.com/users/SpectraLogic/events{/privacy}","received_events_url":"https://api.github.com/users/SpectraLogic/received_events","type":"Organization","site_admin":false},"repo":{"id":18420404,"name":"ds3_java_cli","full_name":"SpectraLogic/ds3_java_cli","owner":{"login":"SpectraLogic","id":7060807,"avatar_url":"https://avatars.githubusercontent.com/u/7060807?v=3","gravatar_id":"","url":"https://api.github.com/users/SpectraLogic","html_url":"https://github.com/SpectraLogic","followers_url":"https://api.github.com/users/SpectraLogic/followers","following_url":"https://api.github.com/users/SpectraLogic/following{/other_user}","gists_url":"https://api.github.com/users/SpectraLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/SpectraLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpectraLogic/subscriptions","organizations_url":"https://api.github.com/users/SpectraLogic/orgs","repos_url":"https://api.github.com/users/SpectraLogic/repos","events_url":"https://api.github.com/users/SpectraLogic/events{/privacy}","received_events_url":"https://api.github.com/users/SpectraLogic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpectraLogic/ds3_java_cli","description":null,"fork":false,"url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli","forks_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/forks","keys_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/teams","hooks_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/hooks","issue_events_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/events{/number}","events_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/events","assignees_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/assignees{/user}","branches_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/branches{/branch}","tags_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/tags","blobs_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/statuses/{sha}","languages_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/languages","stargazers_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/stargazers","contributors_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/contributors","subscribers_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/subscribers","subscription_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/subscription","commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/contents/{+path}","compare_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/merges","archive_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/downloads","issues_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues{/number}","pulls_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls{/number}","milestones_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/milestones{/number}","notifications_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/labels{/name}","releases_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/releases{/id}","deployments_url":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/deployments","created_at":"2014-04-03T22:37:19Z","updated_at":"2016-11-07T19:00:18Z","pushed_at":"2016-11-09T20:14:01Z","git_url":"git://github.com/SpectraLogic/ds3_java_cli.git","ssh_url":"git@github.com:SpectraLogic/ds3_java_cli.git","clone_url":"https://github.com/SpectraLogic/ds3_java_cli.git","svn_url":"https://github.com/SpectraLogic/ds3_java_cli","homepage":null,"size":2806,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":1,"forks":9,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146"},"html":{"href":"https://github.com/SpectraLogic/ds3_java_cli/pull/146"},"issue":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/146"},"comments":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/SpectraLogic/ds3_java_cli/statuses/345a4aa5a1353b2b0b12e60e46f31deec5b7f07b"}}}}
{"actor":{"display_login":"rpmoore"}}