{"action":"created","comment":{"url":"https://api.github.com/repos/apache/reef/pulls/comments/48809915","id":48809915,"diff_hunk":"@@ -0,0 +1,43 @@\n+﻿/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+using Org.Apache.REEF.Tang.Annotations;\n+\n+namespace Org.Apache.REEF.IO.TempFileCreation\n+{\n+    /// <summary>\n+    /// Provide interface to wrap temp file folder and temp file folder creation\n+    /// </summary>\n+    [DefaultImplementation(typeof(TempFileCreator))]\n+    public interface ITempFileCreator\n+    {\n+        /// <summary>\n+        /// return the temp folder path\n+        /// </summary>\n+        string TempFileFolder { get; }\n+\n+        /// <summary>\n+        /// CReate a temp folder with given prefix and suffix as part of the name\n+        /// </summary>\n+        /// <param name=\"prefix\"></param>\n+        /// <param name=\"suffix\"></param>\n+        /// <returns></returns>\n+        string CreateTempDirectory(string prefix = \"\", string suffix = \"\");","path":"lang/cs/Org.Apache.REEF.IO/TempFileCreation/ITempFileCreator.cs","position":41,"original_position":41,"commit_id":"150ae92d036d3cd6693807ce5cb0867e60543e82","original_commit_id":"405ace4d4fc32e68a53890d9c948a816bde83f4a","user":{"login":"markusweimer","id":502371,"avatar_url":"https://avatars.githubusercontent.com/u/502371?v=3","gravatar_id":"","url":"https://api.github.com/users/markusweimer","html_url":"https://github.com/markusweimer","followers_url":"https://api.github.com/users/markusweimer/followers","following_url":"https://api.github.com/users/markusweimer/following{/other_user}","gists_url":"https://api.github.com/users/markusweimer/gists{/gist_id}","starred_url":"https://api.github.com/users/markusweimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markusweimer/subscriptions","organizations_url":"https://api.github.com/users/markusweimer/orgs","repos_url":"https://api.github.com/users/markusweimer/repos","events_url":"https://api.github.com/users/markusweimer/events{/privacy}","received_events_url":"https://api.github.com/users/markusweimer/received_events","type":"User","site_admin":false},"body":"I think we are talking cross purpose. Let me try again :-)\r\n\r\nWhat I am suggesting is a new method `string GetTempFileName(string prefix, string suffix)`. It returns the *absolute path* of a new temp file (that doesn't exist yet). Each time it is called, it returns a *new* file name. Skipping all sorts of defensive programming, a simple implementation could consist of:\r\n\r\n```cs\r\npublic string GetTempFileName(string prefix, string suffix){\r\n  return Path.GetFullPath(Path.Combine(_tempFileFolder, prefix+Guid.NewGuid().ToString(\"N\")+suffix));\r\n}\r\n```\r\n\r\nThis is very likely the code users would write around this anyhow after calling `GetTempFileFolder` in this class.","created_at":"2016-01-05T03:36:12Z","updated_at":"2016-01-05T03:36:12Z","html_url":"https://github.com/apache/reef/pull/742#discussion_r48809915","pull_request_url":"https://api.github.com/repos/apache/reef/pulls/742","_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/comments/48809915"},"html":{"href":"https://github.com/apache/reef/pull/742#discussion_r48809915"},"pull_request":{"href":"https://api.github.com/repos/apache/reef/pulls/742"}}},"pull_request":{"url":"https://api.github.com/repos/apache/reef/pulls/742","id":54042105,"html_url":"https://github.com/apache/reef/pull/742","diff_url":"https://github.com/apache/reef/pull/742.diff","patch_url":"https://github.com/apache/reef/pull/742.patch","issue_url":"https://api.github.com/repos/apache/reef/issues/742","number":742,"state":"open","locked":false,"title":"[REEF-1080]  Make local temp file configurable in FileSystemInputPart…","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"body":"…ition\r\n\r\n*Add ITempFileCreator interface and WorkingDirectoryTempFileCreator similar as Java did without creating File object as it doesn't make sense in C#\r\n*Add WorkingDirectoryTempFileConfigModule and WorkingDirectoryTempFileConfigProvider\r\n*Add ITempFileCreator as a parameter of FileSystemInputPartition injectable constructor\r\n*add and modifies test cases\r\nJIRA: [REEF-1080](https://issues.apache.org/jira/browse/REEF-1080)\r\n\r\nThis closes #","created_at":"2015-12-17T22:41:33Z","updated_at":"2016-01-05T03:36:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"196eeb5f0689568e81649a1c29ee80ba12250a4b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/reef/pulls/742/commits","review_comments_url":"https://api.github.com/repos/apache/reef/pulls/742/comments","review_comment_url":"https://api.github.com/repos/apache/reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/reef/issues/742/comments","statuses_url":"https://api.github.com/repos/apache/reef/statuses/150ae92d036d3cd6693807ce5cb0867e60543e82","head":{"label":"jwang98052:REEF_1080","ref":"REEF_1080","sha":"150ae92d036d3cd6693807ce5cb0867e60543e82","user":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"repo":{"id":25940156,"name":"reef","full_name":"jwang98052/reef","owner":{"login":"jwang98052","id":5666504,"avatar_url":"https://avatars.githubusercontent.com/u/5666504?v=3","gravatar_id":"","url":"https://api.github.com/users/jwang98052","html_url":"https://github.com/jwang98052","followers_url":"https://api.github.com/users/jwang98052/followers","following_url":"https://api.github.com/users/jwang98052/following{/other_user}","gists_url":"https://api.github.com/users/jwang98052/gists{/gist_id}","starred_url":"https://api.github.com/users/jwang98052/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwang98052/subscriptions","organizations_url":"https://api.github.com/users/jwang98052/orgs","repos_url":"https://api.github.com/users/jwang98052/repos","events_url":"https://api.github.com/users/jwang98052/events{/privacy}","received_events_url":"https://api.github.com/users/jwang98052/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jwang98052/reef","description":"Mirror of Apache REEF (Incubating)","fork":true,"url":"https://api.github.com/repos/jwang98052/reef","forks_url":"https://api.github.com/repos/jwang98052/reef/forks","keys_url":"https://api.github.com/repos/jwang98052/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jwang98052/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jwang98052/reef/teams","hooks_url":"https://api.github.com/repos/jwang98052/reef/hooks","issue_events_url":"https://api.github.com/repos/jwang98052/reef/issues/events{/number}","events_url":"https://api.github.com/repos/jwang98052/reef/events","assignees_url":"https://api.github.com/repos/jwang98052/reef/assignees{/user}","branches_url":"https://api.github.com/repos/jwang98052/reef/branches{/branch}","tags_url":"https://api.github.com/repos/jwang98052/reef/tags","blobs_url":"https://api.github.com/repos/jwang98052/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jwang98052/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jwang98052/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/jwang98052/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jwang98052/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/jwang98052/reef/languages","stargazers_url":"https://api.github.com/repos/jwang98052/reef/stargazers","contributors_url":"https://api.github.com/repos/jwang98052/reef/contributors","subscribers_url":"https://api.github.com/repos/jwang98052/reef/subscribers","subscription_url":"https://api.github.com/repos/jwang98052/reef/subscription","commits_url":"https://api.github.com/repos/jwang98052/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/jwang98052/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/jwang98052/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/jwang98052/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/jwang98052/reef/contents/{+path}","compare_url":"https://api.github.com/repos/jwang98052/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jwang98052/reef/merges","archive_url":"https://api.github.com/repos/jwang98052/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jwang98052/reef/downloads","issues_url":"https://api.github.com/repos/jwang98052/reef/issues{/number}","pulls_url":"https://api.github.com/repos/jwang98052/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/jwang98052/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/jwang98052/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jwang98052/reef/labels{/name}","releases_url":"https://api.github.com/repos/jwang98052/reef/releases{/id}","created_at":"2014-10-29T20:32:40Z","updated_at":"2015-12-02T18:42:15Z","pushed_at":"2016-01-04T20:26:57Z","git_url":"git://github.com/jwang98052/reef.git","ssh_url":"git@github.com:jwang98052/reef.git","clone_url":"https://github.com/jwang98052/reef.git","svn_url":"https://github.com/jwang98052/reef","homepage":null,"size":34928,"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":"apache:master","ref":"master","sha":"f13ab65c80b0313659427977b706c5cd6e47a07b","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":25623941,"name":"reef","full_name":"apache/reef","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/reef","description":"Mirror of Apache REEF","fork":false,"url":"https://api.github.com/repos/apache/reef","forks_url":"https://api.github.com/repos/apache/reef/forks","keys_url":"https://api.github.com/repos/apache/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/reef/teams","hooks_url":"https://api.github.com/repos/apache/reef/hooks","issue_events_url":"https://api.github.com/repos/apache/reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/reef/events","assignees_url":"https://api.github.com/repos/apache/reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/reef/tags","blobs_url":"https://api.github.com/repos/apache/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/reef/languages","stargazers_url":"https://api.github.com/repos/apache/reef/stargazers","contributors_url":"https://api.github.com/repos/apache/reef/contributors","subscribers_url":"https://api.github.com/repos/apache/reef/subscribers","subscription_url":"https://api.github.com/repos/apache/reef/subscription","commits_url":"https://api.github.com/repos/apache/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/reef/merges","archive_url":"https://api.github.com/repos/apache/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/reef/downloads","issues_url":"https://api.github.com/repos/apache/reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/reef/releases{/id}","created_at":"2014-10-23T07:00:10Z","updated_at":"2015-12-18T12:30:36Z","pushed_at":"2016-01-04T20:26:58Z","git_url":"git://github.com/apache/reef.git","ssh_url":"git@github.com:apache/reef.git","clone_url":"https://github.com/apache/reef.git","svn_url":"https://github.com/apache/reef","homepage":"","size":45356,"stargazers_count":37,"watchers_count":37,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":"git://git.apache.org/reef.git","open_issues_count":7,"forks":42,"open_issues":7,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/742"},"html":{"href":"https://github.com/apache/reef/pull/742"},"issue":{"href":"https://api.github.com/repos/apache/reef/issues/742"},"comments":{"href":"https://api.github.com/repos/apache/reef/issues/742/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/reef/pulls/742/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/reef/pulls/742/commits"},"statuses":{"href":"https://api.github.com/repos/apache/reef/statuses/150ae92d036d3cd6693807ce5cb0867e60543e82"}}}}