~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit.Test/NGit.Junit/JGitTestUtil.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
                        return path;
145
145
                }
146
146
 
 
147
                /// <exception cref="System.IO.IOException"></exception>
 
148
                public static FilePath WriteTrashFile(FileRepository db, string subdir, string name
 
149
                        , string data)
 
150
                {
 
151
                        FilePath path = new FilePath(db.WorkTree + "/" + subdir, name);
 
152
                        Write(path, data);
 
153
                        return path;
 
154
                }
 
155
 
147
156
                /// <summary>Write a string as a UTF-8 file.</summary>
148
157
                /// <remarks>Write a string as a UTF-8 file.</remarks>
149
158
                /// <param name="f">
169
178
                        }
170
179
                }
171
180
 
 
181
                /// <summary>Fully read a UTF-8 file and return as a string.</summary>
 
182
                /// <remarks>Fully read a UTF-8 file and return as a string.</remarks>
 
183
                /// <param name="file">file to read the content of.</param>
 
184
                /// <returns>
 
185
                /// UTF-8 decoded content of the file, empty string if the file
 
186
                /// exists but has no content.
 
187
                /// </returns>
 
188
                /// <exception cref="System.IO.IOException">the file does not exist, or could not be read.
 
189
                ///     </exception>
 
190
                public static string Read(FilePath file)
 
191
                {
 
192
                        byte[] body = IOUtil.ReadFully(file);
 
193
                        return Sharpen.Runtime.GetStringForBytes(body, 0, body.Length, "UTF-8");
 
194
                }
 
195
 
 
196
                /// <exception cref="System.IO.IOException"></exception>
 
197
                public static string Read(FileRepository db, string name)
 
198
                {
 
199
                        FilePath file = new FilePath(db.WorkTree, name);
 
200
                        return Read(file);
 
201
                }
 
202
 
172
203
                /// <exception cref="System.IO.IOException"></exception>
173
204
                public static void DeleteTrashFile(FileRepository db, string name)
174
205
                {