{"action":"created","comment":{"url":"https://api.github.com/repos/exodev/ecms/pulls/comments/51430312","id":51430312,"diff_hunk":"@@ -91,6 +92,8 @@ public PDFViewerRESTService(RepositoryService repositoryService,\n     }else{\r\n       pdfCache = caService.getCacheInstance(PDFViewerRESTService.class.getName());\r\n     }\r\n+    PDFViewerListener pdfViewerListener = new PDFViewerListener();\r\n+    pdfCache.addCacheListener(pdfViewerListener);\r","path":"core/connector/src/main/java/org/exoplatform/wcm/connector/viewer/PDFViewerRESTService.java","position":13,"original_position":13,"commit_id":"b97eae2033a36f365800a82751c290b74155e7bc","original_commit_id":"b97eae2033a36f365800a82751c290b74155e7bc","user":{"login":"ahamdi","id":677135,"avatar_url":"https://avatars.githubusercontent.com/u/677135?v=3","gravatar_id":"","url":"https://api.github.com/users/ahamdi","html_url":"https://github.com/ahamdi","followers_url":"https://api.github.com/users/ahamdi/followers","following_url":"https://api.github.com/users/ahamdi/following{/other_user}","gists_url":"https://api.github.com/users/ahamdi/gists{/gist_id}","starred_url":"https://api.github.com/users/ahamdi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahamdi/subscriptions","organizations_url":"https://api.github.com/users/ahamdi/orgs","repos_url":"https://api.github.com/users/ahamdi/repos","events_url":"https://api.github.com/users/ahamdi/events{/privacy}","received_events_url":"https://api.github.com/users/ahamdi/received_events","type":"User","site_admin":false},"body":"Both lines should be integrated in the else block. Are you sure that it is needed to create the cache here ? Isn't it created already at the PDFViewerService level ? We can add PDFViewerService as a constructor parameter, this will help avoid doing this again.","created_at":"2016-02-01T15:22:05Z","updated_at":"2016-02-01T15:22:05Z","html_url":"https://github.com/exodev/ecms/pull/176#discussion_r51430312","pull_request_url":"https://api.github.com/repos/exodev/ecms/pulls/176","_links":{"self":{"href":"https://api.github.com/repos/exodev/ecms/pulls/comments/51430312"},"html":{"href":"https://github.com/exodev/ecms/pull/176#discussion_r51430312"},"pull_request":{"href":"https://api.github.com/repos/exodev/ecms/pulls/176"}}},"pull_request":{"url":"https://api.github.com/repos/exodev/ecms/pulls/176","id":57814711,"html_url":"https://github.com/exodev/ecms/pull/176","diff_url":"https://github.com/exodev/ecms/pull/176.diff","patch_url":"https://github.com/exodev/ecms/pull/176.patch","issue_url":"https://api.github.com/repos/exodev/ecms/issues/176","number":176,"state":"open","locked":false,"title":"[ECMS-6660][PDF Viewer] Persistent PDF files in temp folder","user":{"login":"AtiaZ","id":9840224,"avatar_url":"https://avatars.githubusercontent.com/u/9840224?v=3","gravatar_id":"","url":"https://api.github.com/users/AtiaZ","html_url":"https://github.com/AtiaZ","followers_url":"https://api.github.com/users/AtiaZ/followers","following_url":"https://api.github.com/users/AtiaZ/following{/other_user}","gists_url":"https://api.github.com/users/AtiaZ/gists{/gist_id}","starred_url":"https://api.github.com/users/AtiaZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AtiaZ/subscriptions","organizations_url":"https://api.github.com/users/AtiaZ/orgs","repos_url":"https://api.github.com/users/AtiaZ/repos","events_url":"https://api.github.com/users/AtiaZ/events{/privacy}","received_events_url":"https://api.github.com/users/AtiaZ/received_events","type":"User","site_admin":false},"body":"Fix description : \r\n\r\n * Add a new CacheListener in order to delete files from the temp folder when : \r\n1. The object which ensure the storage of the file's path in the pdfcache is expired (for example when exceeding the maxSize).\r\n2. The clearCache() method is invoked (from jconsole as an example).\r\n3. The PLF server is stopped.","created_at":"2016-02-01T09:30:39Z","updated_at":"2016-02-01T15:22:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f34fbad8dd812c681746865cc3b7dca1f80e1b80","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/exodev/ecms/pulls/176/commits","review_comments_url":"https://api.github.com/repos/exodev/ecms/pulls/176/comments","review_comment_url":"https://api.github.com/repos/exodev/ecms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/exodev/ecms/issues/176/comments","statuses_url":"https://api.github.com/repos/exodev/ecms/statuses/b97eae2033a36f365800a82751c290b74155e7bc","head":{"label":"exodev:fix/4.3.x/ECMS-6660","ref":"fix/4.3.x/ECMS-6660","sha":"b97eae2033a36f365800a82751c290b74155e7bc","user":{"login":"exodev","id":1606522,"avatar_url":"https://avatars.githubusercontent.com/u/1606522?v=3","gravatar_id":"","url":"https://api.github.com/users/exodev","html_url":"https://github.com/exodev","followers_url":"https://api.github.com/users/exodev/followers","following_url":"https://api.github.com/users/exodev/following{/other_user}","gists_url":"https://api.github.com/users/exodev/gists{/gist_id}","starred_url":"https://api.github.com/users/exodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exodev/subscriptions","organizations_url":"https://api.github.com/users/exodev/orgs","repos_url":"https://api.github.com/users/exodev/repos","events_url":"https://api.github.com/users/exodev/events{/privacy}","received_events_url":"https://api.github.com/users/exodev/received_events","type":"Organization","site_admin":false},"repo":{"id":4003238,"name":"ecms","full_name":"exodev/ecms","owner":{"login":"exodev","id":1606522,"avatar_url":"https://avatars.githubusercontent.com/u/1606522?v=3","gravatar_id":"","url":"https://api.github.com/users/exodev","html_url":"https://github.com/exodev","followers_url":"https://api.github.com/users/exodev/followers","following_url":"https://api.github.com/users/exodev/following{/other_user}","gists_url":"https://api.github.com/users/exodev/gists{/gist_id}","starred_url":"https://api.github.com/users/exodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exodev/subscriptions","organizations_url":"https://api.github.com/users/exodev/orgs","repos_url":"https://api.github.com/users/exodev/repos","events_url":"https://api.github.com/users/exodev/events{/privacy}","received_events_url":"https://api.github.com/users/exodev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exodev/ecms","description":"eXo ECMS","fork":true,"url":"https://api.github.com/repos/exodev/ecms","forks_url":"https://api.github.com/repos/exodev/ecms/forks","keys_url":"https://api.github.com/repos/exodev/ecms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exodev/ecms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exodev/ecms/teams","hooks_url":"https://api.github.com/repos/exodev/ecms/hooks","issue_events_url":"https://api.github.com/repos/exodev/ecms/issues/events{/number}","events_url":"https://api.github.com/repos/exodev/ecms/events","assignees_url":"https://api.github.com/repos/exodev/ecms/assignees{/user}","branches_url":"https://api.github.com/repos/exodev/ecms/branches{/branch}","tags_url":"https://api.github.com/repos/exodev/ecms/tags","blobs_url":"https://api.github.com/repos/exodev/ecms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exodev/ecms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exodev/ecms/git/refs{/sha}","trees_url":"https://api.github.com/repos/exodev/ecms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exodev/ecms/statuses/{sha}","languages_url":"https://api.github.com/repos/exodev/ecms/languages","stargazers_url":"https://api.github.com/repos/exodev/ecms/stargazers","contributors_url":"https://api.github.com/repos/exodev/ecms/contributors","subscribers_url":"https://api.github.com/repos/exodev/ecms/subscribers","subscription_url":"https://api.github.com/repos/exodev/ecms/subscription","commits_url":"https://api.github.com/repos/exodev/ecms/commits{/sha}","git_commits_url":"https://api.github.com/repos/exodev/ecms/git/commits{/sha}","comments_url":"https://api.github.com/repos/exodev/ecms/comments{/number}","issue_comment_url":"https://api.github.com/repos/exodev/ecms/issues/comments{/number}","contents_url":"https://api.github.com/repos/exodev/ecms/contents/{+path}","compare_url":"https://api.github.com/repos/exodev/ecms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exodev/ecms/merges","archive_url":"https://api.github.com/repos/exodev/ecms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exodev/ecms/downloads","issues_url":"https://api.github.com/repos/exodev/ecms/issues{/number}","pulls_url":"https://api.github.com/repos/exodev/ecms/pulls{/number}","milestones_url":"https://api.github.com/repos/exodev/ecms/milestones{/number}","notifications_url":"https://api.github.com/repos/exodev/ecms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exodev/ecms/labels{/name}","releases_url":"https://api.github.com/repos/exodev/ecms/releases{/id}","deployments_url":"https://api.github.com/repos/exodev/ecms/deployments","created_at":"2012-04-12T09:40:08Z","updated_at":"2015-05-08T05:13:42Z","pushed_at":"2016-02-01T09:30:39Z","git_url":"git://github.com/exodev/ecms.git","ssh_url":"git@github.com:exodev/ecms.git","clone_url":"https://github.com/exodev/ecms.git","svn_url":"https://github.com/exodev/ecms","homepage":null,"size":183817,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":68,"forks":11,"open_issues":68,"watchers":4,"default_branch":"develop"}},"base":{"label":"exodev:develop","ref":"develop","sha":"57b3ae6b649d397b21a58b9da4d1ab29f8f10fc1","user":{"login":"exodev","id":1606522,"avatar_url":"https://avatars.githubusercontent.com/u/1606522?v=3","gravatar_id":"","url":"https://api.github.com/users/exodev","html_url":"https://github.com/exodev","followers_url":"https://api.github.com/users/exodev/followers","following_url":"https://api.github.com/users/exodev/following{/other_user}","gists_url":"https://api.github.com/users/exodev/gists{/gist_id}","starred_url":"https://api.github.com/users/exodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exodev/subscriptions","organizations_url":"https://api.github.com/users/exodev/orgs","repos_url":"https://api.github.com/users/exodev/repos","events_url":"https://api.github.com/users/exodev/events{/privacy}","received_events_url":"https://api.github.com/users/exodev/received_events","type":"Organization","site_admin":false},"repo":{"id":4003238,"name":"ecms","full_name":"exodev/ecms","owner":{"login":"exodev","id":1606522,"avatar_url":"https://avatars.githubusercontent.com/u/1606522?v=3","gravatar_id":"","url":"https://api.github.com/users/exodev","html_url":"https://github.com/exodev","followers_url":"https://api.github.com/users/exodev/followers","following_url":"https://api.github.com/users/exodev/following{/other_user}","gists_url":"https://api.github.com/users/exodev/gists{/gist_id}","starred_url":"https://api.github.com/users/exodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exodev/subscriptions","organizations_url":"https://api.github.com/users/exodev/orgs","repos_url":"https://api.github.com/users/exodev/repos","events_url":"https://api.github.com/users/exodev/events{/privacy}","received_events_url":"https://api.github.com/users/exodev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/exodev/ecms","description":"eXo ECMS","fork":true,"url":"https://api.github.com/repos/exodev/ecms","forks_url":"https://api.github.com/repos/exodev/ecms/forks","keys_url":"https://api.github.com/repos/exodev/ecms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/exodev/ecms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/exodev/ecms/teams","hooks_url":"https://api.github.com/repos/exodev/ecms/hooks","issue_events_url":"https://api.github.com/repos/exodev/ecms/issues/events{/number}","events_url":"https://api.github.com/repos/exodev/ecms/events","assignees_url":"https://api.github.com/repos/exodev/ecms/assignees{/user}","branches_url":"https://api.github.com/repos/exodev/ecms/branches{/branch}","tags_url":"https://api.github.com/repos/exodev/ecms/tags","blobs_url":"https://api.github.com/repos/exodev/ecms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/exodev/ecms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/exodev/ecms/git/refs{/sha}","trees_url":"https://api.github.com/repos/exodev/ecms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/exodev/ecms/statuses/{sha}","languages_url":"https://api.github.com/repos/exodev/ecms/languages","stargazers_url":"https://api.github.com/repos/exodev/ecms/stargazers","contributors_url":"https://api.github.com/repos/exodev/ecms/contributors","subscribers_url":"https://api.github.com/repos/exodev/ecms/subscribers","subscription_url":"https://api.github.com/repos/exodev/ecms/subscription","commits_url":"https://api.github.com/repos/exodev/ecms/commits{/sha}","git_commits_url":"https://api.github.com/repos/exodev/ecms/git/commits{/sha}","comments_url":"https://api.github.com/repos/exodev/ecms/comments{/number}","issue_comment_url":"https://api.github.com/repos/exodev/ecms/issues/comments{/number}","contents_url":"https://api.github.com/repos/exodev/ecms/contents/{+path}","compare_url":"https://api.github.com/repos/exodev/ecms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/exodev/ecms/merges","archive_url":"https://api.github.com/repos/exodev/ecms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/exodev/ecms/downloads","issues_url":"https://api.github.com/repos/exodev/ecms/issues{/number}","pulls_url":"https://api.github.com/repos/exodev/ecms/pulls{/number}","milestones_url":"https://api.github.com/repos/exodev/ecms/milestones{/number}","notifications_url":"https://api.github.com/repos/exodev/ecms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/exodev/ecms/labels{/name}","releases_url":"https://api.github.com/repos/exodev/ecms/releases{/id}","deployments_url":"https://api.github.com/repos/exodev/ecms/deployments","created_at":"2012-04-12T09:40:08Z","updated_at":"2015-05-08T05:13:42Z","pushed_at":"2016-02-01T09:30:39Z","git_url":"git://github.com/exodev/ecms.git","ssh_url":"git@github.com:exodev/ecms.git","clone_url":"https://github.com/exodev/ecms.git","svn_url":"https://github.com/exodev/ecms","homepage":null,"size":183817,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":68,"forks":11,"open_issues":68,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/exodev/ecms/pulls/176"},"html":{"href":"https://github.com/exodev/ecms/pull/176"},"issue":{"href":"https://api.github.com/repos/exodev/ecms/issues/176"},"comments":{"href":"https://api.github.com/repos/exodev/ecms/issues/176/comments"},"review_comments":{"href":"https://api.github.com/repos/exodev/ecms/pulls/176/comments"},"review_comment":{"href":"https://api.github.com/repos/exodev/ecms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/exodev/ecms/pulls/176/commits"},"statuses":{"href":"https://api.github.com/repos/exodev/ecms/statuses/b97eae2033a36f365800a82751c290b74155e7bc"}}}}