Skip to content

Commit 84f3a28

Browse files
committed
Move UploadTime to ScpClient.NET.cs, and sync legacy project files.
1 parent b70e218 commit 84f3a28

File tree

7 files changed

+34
-19
lines changed

7 files changed

+34
-19
lines changed

src/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@
209209
<Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
210210
<Link>Common\PortForwardEventArgs.cs</Link>
211211
</Compile>
212+
<Compile Include="..\Renci.SshNet\Common\PosixPath.cs">
213+
<Link>Common\PosixPath.cs</Link>
214+
</Compile>
212215
<Compile Include="..\Renci.SshNet\Common\ProxyException.cs">
213216
<Link>Common\ProxyException.cs</Link>
214217
</Compile>
@@ -946,7 +949,7 @@
946949
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
947950
<SilverlightProjectProperties />
948951
</FlavorProperties>
949-
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
952+
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
950953
</VisualStudio>
951954
</ProjectExtensions>
952955
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/Renci.SshNet.Silverlight5/Renci.SshNet.Silverlight5.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@
218218
<Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
219219
<Link>Common\PortForwardEventArgs.cs</Link>
220220
</Compile>
221+
<Compile Include="..\Renci.SshNet\Common\PosixPath.cs">
222+
<Link>Common\PosixPath.cs</Link>
223+
</Compile>
221224
<Compile Include="..\Renci.SshNet\Common\ProxyException.cs">
222225
<Link>Common\ProxyException.cs</Link>
223226
</Compile>
@@ -952,7 +955,7 @@
952955
<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
953956
<SilverlightProjectProperties />
954957
</FlavorProperties>
955-
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
958+
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
956959
</VisualStudio>
957960
</ProjectExtensions>
958961
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/Renci.SshNet.UAP10/Renci.SshNet.UAP10.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@
258258
<Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
259259
<Link>Common\PortForwardEventArgs.cs</Link>
260260
</Compile>
261+
<Compile Include="..\Renci.SshNet\Common\PosixPath.cs">
262+
<Link>Common\PosixPath.cs</Link>
263+
</Compile>
261264
<Compile Include="..\Renci.SshNet\Common\ProxyException.cs">
262265
<Link>Common\ProxyException.cs</Link>
263266
</Compile>

src/Renci.SshNet.WindowsPhone/Renci.SshNet.WindowsPhone.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@
200200
<Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
201201
<Link>Common\PortForwardEventArgs.cs</Link>
202202
</Compile>
203+
<Compile Include="..\Renci.SshNet\Common\PosixPath.cs">
204+
<Link>Common\PosixPath.cs</Link>
205+
</Compile>
203206
<Compile Include="..\Renci.SshNet\Common\ProxyException.cs">
204207
<Link>Common\ProxyException.cs</Link>
205208
</Compile>

src/Renci.SshNet.WindowsPhone8/Renci.SshNet.WindowsPhone8.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@
241241
<Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
242242
<Link>Common\PortForwardEventArgs.cs</Link>
243243
</Compile>
244+
<Compile Include="..\Renci.SshNet\Common\PosixPath.cs">
245+
<Link>Common\PosixPath.cs</Link>
246+
</Compile>
244247
<Compile Include="..\Renci.SshNet\Common\ProxyException.cs">
245248
<Link>Common\ProxyException.cs</Link>
246249
</Compile>
@@ -979,7 +982,7 @@
979982
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
980983
<ProjectExtensions>
981984
<VisualStudio>
982-
<UserProperties ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" />
985+
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="2f5f8c90-0bd1-424f-997c-7bc6280919d1" />
983986
</VisualStudio>
984987
</ProjectExtensions>
985988
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

src/Renci.SshNet/ScpClient.NET.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,22 @@ public void Download(string directoryName, DirectoryInfo directoryInfo)
139139
}
140140
}
141141

142+
/// <summary>
143+
/// Uploads the <see cref="FileSystemInfo.LastWriteTimeUtc"/> and <see cref="FileSystemInfo.LastAccessTimeUtc"/>
144+
/// of the next file or directory to upload.
145+
/// </summary>
146+
/// <param name="channel">The channel to perform the upload in.</param>
147+
/// <param name="input">A <see cref="Stream"/> from which any feedback from the server can be read.</param>
148+
/// <param name="fileOrDirectory">The file or directory to upload.</param>
149+
private void UploadTimes(IChannelSession channel, Stream input, FileSystemInfo fileOrDirectory)
150+
{
151+
var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
152+
var modificationSeconds = (long) (fileOrDirectory.LastWriteTimeUtc - zeroTime).TotalSeconds;
153+
var accessSeconds = (long) (fileOrDirectory.LastAccessTimeUtc - zeroTime).TotalSeconds;
154+
SendData(channel, string.Format("T{0} 0 {1} 0\n", modificationSeconds, accessSeconds));
155+
CheckReturnCode(input);
156+
}
157+
142158
/// <summary>
143159
/// Upload the files and subdirectories in the specified directory.
144160
/// </summary>

src/Renci.SshNet/ScpClient.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,6 @@ public void Download(string filename, Stream destination)
243243
}
244244
}
245245

246-
/// <summary>
247-
/// Uploads the <see cref="FileSystemInfo.LastWriteTimeUtc"/> and <see cref="FileSystemInfo.LastAccessTimeUtc"/>
248-
/// of the next file or directory to upload.
249-
/// </summary>
250-
/// <param name="channel">The channel to perform the upload in.</param>
251-
/// <param name="input">A <see cref="Stream"/> from which any feedback from the server can be read.</param>
252-
/// <param name="fileOrDirectory">The file or directory to upload.</param>
253-
private void UploadTimes(IChannelSession channel, Stream input, FileSystemInfo fileOrDirectory)
254-
{
255-
var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
256-
var modificationSeconds = (long) (fileOrDirectory.LastWriteTimeUtc - zeroTime).TotalSeconds;
257-
var accessSeconds = (long) (fileOrDirectory.LastAccessTimeUtc - zeroTime).TotalSeconds;
258-
SendData(channel, string.Format("T{0} 0 {1} 0\n", modificationSeconds, accessSeconds));
259-
CheckReturnCode(input);
260-
}
261-
262246
/// <summary>
263247
/// Sets mode, size and name of file being upload.
264248
/// </summary>

0 commit comments

Comments
 (0)