Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1212)

Side by Side Diff: Tools/Google.Apis.Utils/DirectoryUtilities.cs

Issue 12767046: Issue 377: New build for releasing a new version (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: david comments Created 10 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Copyright 2013 Google Inc 2 Copyright 2013 Google Inc
3 3
4 Licensed under the Apache License, Version 2.0 (the "License"); 4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License. 5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at 6 You may obtain a copy of the License at
7 7
8 http://www.apache.org/licenses/LICENSE-2.0 8 http://www.apache.org/licenses/LICENSE-2.0
9 9
10 Unless required by applicable law or agreed to in writing, software 10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS, 11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and 13 See the License for the specific language governing permissions and
14 limitations under the License. 14 limitations under the License.
15 */ 15 */
16 16
17 using System.Diagnostics; 17 using System.Diagnostics;
18 using System.IO; 18 using System.IO;
19 using System.Linq; 19 using System.Linq;
20 20
21 using Google.Apis.Utils.Trace;
22
21 namespace Google.Apis.Utils 23 namespace Google.Apis.Utils
22 { 24 {
23 /// <summary>Directory utilities which support copying, clearing and other o perations on directories.</summary> 25 /// <summary>Directory utilities which support copying, clearing and other o perations on directories.</summary>
24 public static class DirectoryUtilities 26 public static class DirectoryUtilities
25 { 27 {
26 private static readonly TraceSource TraceSource = new TraceSource("Googl e.Apis"); 28 private static readonly TraceSource TraceSource = new TraceSource("Googl e.Apis");
27 29
28 /// <summary>Copies a directory recursively to a new one.</summary> 30 /// <summary>Copies a directory recursively to a new one.</summary>
29 /// <param name="sourceDir">Source directory</param> 31 /// <param name="sourceDir">Source directory</param>
30 /// <param name="destDir">Destination directory</param> 32 /// <param name="destDir">Destination directory</param>
31 internal static void CopyDirectory(string sourceDir, string destDir) 33 public static void CopyDirectory(string sourceDir, string destDir)
32 { 34 {
33 DirectoryInfo dir = new DirectoryInfo(sourceDir); 35 DirectoryInfo dir = new DirectoryInfo(sourceDir);
34 if (!dir.Exists) 36 if (!dir.Exists)
35 { 37 {
36 throw new DirectoryNotFoundException( 38 throw new DirectoryNotFoundException(
37 string.Format("Source directory \"{0}\" does not exist", sou rceDir)); 39 string.Format("Source directory \"{0}\" does not exist", sou rceDir));
38 } 40 }
39 41
40 ClearOrCreateDirectory(destDir); 42 ClearOrCreateDirectory(destDir);
41 43
(...skipping 27 matching lines...) Expand all
69 71
70 if (!absoluteChild.StartsWith(absoluteParent Path.DirectorySeparat orChar)) 72 if (!absoluteChild.StartsWith(absoluteParent Path.DirectorySeparat orChar))
71 { 73 {
72 return absoluteChild; // Nothing in common. 74 return absoluteChild; // Nothing in common.
73 } 75 }
74 76
75 return absoluteChild.Substring(absoluteParent.Length 1); 77 return absoluteChild.Substring(absoluteParent.Length 1);
76 } 78 }
77 } 79 }
78 } 80 }
OLDNEW
« no previous file with comments | « Tools/Google.Apis.Release/packages.config ('k') | Tools/Google.Apis.Utils/Google.Apis.Utils.csproj » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b