{"action":"created","comment":{"url":"https://api.github.com/repos/codice/alliance/pulls/comments/77878777","id":77878777,"diff_hunk":"@@ -210,14 +211,23 @@ private ContentItem createDerivedImage(String id, String qualifier, BufferedImag\n         return null;\n     }\n \n-    protected String buildDerivedImageTitle(String title, String qualifier) {\n+    String buildDerivedImageTitle(String title, String qualifier) {\n+        String derivedImageTitle;\n         String rootFileName = FilenameUtils.getBaseName(title);\n \n-        return (StringUtils.isNotBlank(rootFileName) &&\n-                StringUtils.isNotBlank(rootFileName.replaceAll(\"[^A-Za-z0-9]\", \"\"))) // any human readable content\n-                ? String.format(DERIVED_IMAGE_FILENAME_PATTERN, qualifier,\n-                        rootFileName.replaceAll(INVALID_FILENAME_CHARACTER_REGEX, \"\"), JPG)\n-                : String.format(\"%s.%s\", qualifier, JPG);\n+        // title must contain some alphanumeric, human readable characters, or use default filename\n+        if (StringUtils.isNotBlank(rootFileName)\n+                && StringUtils.isNotBlank(rootFileName.replaceAll(\"[^A-Za-z0-9]\", \"\"))) {","path":"catalog/imaging/imaging-transformer-nitf/src/main/java/org/codice/alliance/transformer/nitf/image/NitfPreStoragePlugin.java","position":null,"original_position":24,"commit_id":"6477c5e7630d4c5420d9eccc2426dad7fcd881cb","original_commit_id":"5d8eb6497fb801f5b8b82a61fa7df003c4a61f85","user":{"login":"coyotesqrl","id":1469860,"avatar_url":"https://avatars.githubusercontent.com/u/1469860?v=3","gravatar_id":"","url":"https://api.github.com/users/coyotesqrl","html_url":"https://github.com/coyotesqrl","followers_url":"https://api.github.com/users/coyotesqrl/followers","following_url":"https://api.github.com/users/coyotesqrl/following{/other_user}","gists_url":"https://api.github.com/users/coyotesqrl/gists{/gist_id}","starred_url":"https://api.github.com/users/coyotesqrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coyotesqrl/subscriptions","organizations_url":"https://api.github.com/users/coyotesqrl/orgs","repos_url":"https://api.github.com/users/coyotesqrl/repos","events_url":"https://api.github.com/users/coyotesqrl/events{/privacy}","received_events_url":"https://api.github.com/users/coyotesqrl/received_events","type":"User","site_admin":false},"body":"Should have asked this before...the only difference between this regex and the other one you're using is the underscore. Is there a reason for that? Could you just use the const here?","created_at":"2016-09-07T18:31:20Z","updated_at":"2016-09-07T18:31:20Z","html_url":"https://github.com/codice/alliance/pull/139#discussion_r77878777","pull_request_url":"https://api.github.com/repos/codice/alliance/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/codice/alliance/pulls/comments/77878777"},"html":{"href":"https://github.com/codice/alliance/pull/139#discussion_r77878777"},"pull_request":{"href":"https://api.github.com/repos/codice/alliance/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/codice/alliance/pulls/139","id":84198065,"html_url":"https://github.com/codice/alliance/pull/139","diff_url":"https://github.com/codice/alliance/pull/139.diff","patch_url":"https://github.com/codice/alliance/pull/139.patch","issue_url":"https://api.github.com/repos/codice/alliance/issues/139","number":139,"state":"open","locked":false,"title":"CAL-126 Filter invalid characters from derived image filenames","user":{"login":"lcrosenbu","id":16792154,"avatar_url":"https://avatars.githubusercontent.com/u/16792154?v=3","gravatar_id":"","url":"https://api.github.com/users/lcrosenbu","html_url":"https://github.com/lcrosenbu","followers_url":"https://api.github.com/users/lcrosenbu/followers","following_url":"https://api.github.com/users/lcrosenbu/following{/other_user}","gists_url":"https://api.github.com/users/lcrosenbu/gists{/gist_id}","starred_url":"https://api.github.com/users/lcrosenbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcrosenbu/subscriptions","organizations_url":"https://api.github.com/users/lcrosenbu/orgs","repos_url":"https://api.github.com/users/lcrosenbu/repos","events_url":"https://api.github.com/users/lcrosenbu/events{/privacy}","received_events_url":"https://api.github.com/users/lcrosenbu/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nCurrently derived images are stored with a filename that is derived from the NITF `FTITLE` field. The `FTITLE` field may contain characters that are invalid for file system storage (e.g. `*` is invalid for Windows system files). This PR strips out invalid characters for the purposes of generating the derived image filename. \r\n\r\n** Unit Tests In Work -- Please Do Not Hero PR **\r\n\r\n#### Who is reviewing it (please choose AT LEAST two reviewers that need to approve the PR before it can get merged; if a component team is listed, at least one of its members needs to approve)?\r\n@bdeining @dcruver \r\n\r\n#### Choose 2 committers to review/merge the PR (please choose ONLY two committers from below, delete the rest).\r\n@coyotesqrl\r\n@jlcsmith\r\n\r\n#### How should this be tested?\r\nIngest a NITF that has a `FTITLE` that contains invalid characters (e.g. `*`) for the file system (e.g. Windows). Verify ingest was successful and derived images can be retrieved. \r\n\r\n#### Any background context you want to provide?\r\n\r\n#### What are the relevant tickets?\r\nhttps://codice.atlassian.net/browse/CAL-126\r\n\r\n#### Screenshots (if appropriate)\r\n\r\n#### Checklist:\r\n- [ ] Documentation Updated\r\n- [ ] Update / Add Unit Tests\r\n- [ ] Update / Add Integration Tests\r\n\r\n","created_at":"2016-09-06T21:16:43Z","updated_at":"2016-09-07T18:31:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c36bbfa62de665939ded5b642f61d5c1cf89af8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/codice/alliance/pulls/139/commits","review_comments_url":"https://api.github.com/repos/codice/alliance/pulls/139/comments","review_comment_url":"https://api.github.com/repos/codice/alliance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/alliance/issues/139/comments","statuses_url":"https://api.github.com/repos/codice/alliance/statuses/6477c5e7630d4c5420d9eccc2426dad7fcd881cb","head":{"label":"lcrosenbu:CAL-126","ref":"CAL-126","sha":"6477c5e7630d4c5420d9eccc2426dad7fcd881cb","user":{"login":"lcrosenbu","id":16792154,"avatar_url":"https://avatars.githubusercontent.com/u/16792154?v=3","gravatar_id":"","url":"https://api.github.com/users/lcrosenbu","html_url":"https://github.com/lcrosenbu","followers_url":"https://api.github.com/users/lcrosenbu/followers","following_url":"https://api.github.com/users/lcrosenbu/following{/other_user}","gists_url":"https://api.github.com/users/lcrosenbu/gists{/gist_id}","starred_url":"https://api.github.com/users/lcrosenbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcrosenbu/subscriptions","organizations_url":"https://api.github.com/users/lcrosenbu/orgs","repos_url":"https://api.github.com/users/lcrosenbu/repos","events_url":"https://api.github.com/users/lcrosenbu/events{/privacy}","received_events_url":"https://api.github.com/users/lcrosenbu/received_events","type":"User","site_admin":false},"repo":{"id":60187605,"name":"alliance","full_name":"lcrosenbu/alliance","owner":{"login":"lcrosenbu","id":16792154,"avatar_url":"https://avatars.githubusercontent.com/u/16792154?v=3","gravatar_id":"","url":"https://api.github.com/users/lcrosenbu","html_url":"https://github.com/lcrosenbu","followers_url":"https://api.github.com/users/lcrosenbu/followers","following_url":"https://api.github.com/users/lcrosenbu/following{/other_user}","gists_url":"https://api.github.com/users/lcrosenbu/gists{/gist_id}","starred_url":"https://api.github.com/users/lcrosenbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcrosenbu/subscriptions","organizations_url":"https://api.github.com/users/lcrosenbu/orgs","repos_url":"https://api.github.com/users/lcrosenbu/repos","events_url":"https://api.github.com/users/lcrosenbu/events{/privacy}","received_events_url":"https://api.github.com/users/lcrosenbu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lcrosenbu/alliance","description":"","fork":true,"url":"https://api.github.com/repos/lcrosenbu/alliance","forks_url":"https://api.github.com/repos/lcrosenbu/alliance/forks","keys_url":"https://api.github.com/repos/lcrosenbu/alliance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lcrosenbu/alliance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lcrosenbu/alliance/teams","hooks_url":"https://api.github.com/repos/lcrosenbu/alliance/hooks","issue_events_url":"https://api.github.com/repos/lcrosenbu/alliance/issues/events{/number}","events_url":"https://api.github.com/repos/lcrosenbu/alliance/events","assignees_url":"https://api.github.com/repos/lcrosenbu/alliance/assignees{/user}","branches_url":"https://api.github.com/repos/lcrosenbu/alliance/branches{/branch}","tags_url":"https://api.github.com/repos/lcrosenbu/alliance/tags","blobs_url":"https://api.github.com/repos/lcrosenbu/alliance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lcrosenbu/alliance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lcrosenbu/alliance/git/refs{/sha}","trees_url":"https://api.github.com/repos/lcrosenbu/alliance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lcrosenbu/alliance/statuses/{sha}","languages_url":"https://api.github.com/repos/lcrosenbu/alliance/languages","stargazers_url":"https://api.github.com/repos/lcrosenbu/alliance/stargazers","contributors_url":"https://api.github.com/repos/lcrosenbu/alliance/contributors","subscribers_url":"https://api.github.com/repos/lcrosenbu/alliance/subscribers","subscription_url":"https://api.github.com/repos/lcrosenbu/alliance/subscription","commits_url":"https://api.github.com/repos/lcrosenbu/alliance/commits{/sha}","git_commits_url":"https://api.github.com/repos/lcrosenbu/alliance/git/commits{/sha}","comments_url":"https://api.github.com/repos/lcrosenbu/alliance/comments{/number}","issue_comment_url":"https://api.github.com/repos/lcrosenbu/alliance/issues/comments{/number}","contents_url":"https://api.github.com/repos/lcrosenbu/alliance/contents/{+path}","compare_url":"https://api.github.com/repos/lcrosenbu/alliance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lcrosenbu/alliance/merges","archive_url":"https://api.github.com/repos/lcrosenbu/alliance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lcrosenbu/alliance/downloads","issues_url":"https://api.github.com/repos/lcrosenbu/alliance/issues{/number}","pulls_url":"https://api.github.com/repos/lcrosenbu/alliance/pulls{/number}","milestones_url":"https://api.github.com/repos/lcrosenbu/alliance/milestones{/number}","notifications_url":"https://api.github.com/repos/lcrosenbu/alliance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lcrosenbu/alliance/labels{/name}","releases_url":"https://api.github.com/repos/lcrosenbu/alliance/releases{/id}","deployments_url":"https://api.github.com/repos/lcrosenbu/alliance/deployments","created_at":"2016-06-01T15:11:16Z","updated_at":"2016-06-01T15:11:20Z","pushed_at":"2016-09-07T18:28:54Z","git_url":"git://github.com/lcrosenbu/alliance.git","ssh_url":"git@github.com:lcrosenbu/alliance.git","clone_url":"https://github.com/lcrosenbu/alliance.git","svn_url":"https://github.com/lcrosenbu/alliance","homepage":null,"size":19175,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"codice:master","ref":"master","sha":"4e0188ad78bc020aa6c05331893200b65c2ad198","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":52804523,"name":"alliance","full_name":"codice/alliance","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/alliance","description":"","fork":false,"url":"https://api.github.com/repos/codice/alliance","forks_url":"https://api.github.com/repos/codice/alliance/forks","keys_url":"https://api.github.com/repos/codice/alliance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/alliance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/alliance/teams","hooks_url":"https://api.github.com/repos/codice/alliance/hooks","issue_events_url":"https://api.github.com/repos/codice/alliance/issues/events{/number}","events_url":"https://api.github.com/repos/codice/alliance/events","assignees_url":"https://api.github.com/repos/codice/alliance/assignees{/user}","branches_url":"https://api.github.com/repos/codice/alliance/branches{/branch}","tags_url":"https://api.github.com/repos/codice/alliance/tags","blobs_url":"https://api.github.com/repos/codice/alliance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/alliance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/alliance/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/alliance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/alliance/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/alliance/languages","stargazers_url":"https://api.github.com/repos/codice/alliance/stargazers","contributors_url":"https://api.github.com/repos/codice/alliance/contributors","subscribers_url":"https://api.github.com/repos/codice/alliance/subscribers","subscription_url":"https://api.github.com/repos/codice/alliance/subscription","commits_url":"https://api.github.com/repos/codice/alliance/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/alliance/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/alliance/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/alliance/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/alliance/contents/{+path}","compare_url":"https://api.github.com/repos/codice/alliance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/alliance/merges","archive_url":"https://api.github.com/repos/codice/alliance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/alliance/downloads","issues_url":"https://api.github.com/repos/codice/alliance/issues{/number}","pulls_url":"https://api.github.com/repos/codice/alliance/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/alliance/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/alliance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/alliance/labels{/name}","releases_url":"https://api.github.com/repos/codice/alliance/releases{/id}","deployments_url":"https://api.github.com/repos/codice/alliance/deployments","created_at":"2016-02-29T16:10:33Z","updated_at":"2016-06-14T21:40:26Z","pushed_at":"2016-09-07T18:28:56Z","git_url":"git://github.com/codice/alliance.git","ssh_url":"git@github.com:codice/alliance.git","clone_url":"https://github.com/codice/alliance.git","svn_url":"https://github.com/codice/alliance","homepage":null,"size":25938,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":9,"forks":28,"open_issues":9,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/alliance/pulls/139"},"html":{"href":"https://github.com/codice/alliance/pull/139"},"issue":{"href":"https://api.github.com/repos/codice/alliance/issues/139"},"comments":{"href":"https://api.github.com/repos/codice/alliance/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/alliance/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/alliance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/alliance/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/codice/alliance/statuses/6477c5e7630d4c5420d9eccc2426dad7fcd881cb"}}}}
{"actor":{"display_login":"coyotesqrl"}}