Skip to content

Commit

Permalink
rename APIs for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
robinrodricks committed Nov 16, 2021
1 parent 184ff72 commit 4e92bb9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
32 changes: 16 additions & 16 deletions FluentFTP/Client/FtpClient_IBMzOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public partial class FtpClient : IDisposable {
/// current working directory.
/// </summary>
/// <returns>The realm</returns>
public FtpzOSListRealm GetzOSListRealm() {
public FtpZOSListRealm GetZOSListRealm() {

// this case occurs immediately after connection and after the working dir has changed
if (_LastWorkingDir == null) {
Expand All @@ -46,12 +46,12 @@ public FtpzOSListRealm GetzOSListRealm() {

if (ServerType != FtpServer.IBMzOSFTP ||
ServerOS != FtpOperatingSystem.IBMzOS) {
return FtpzOSListRealm.Invalid;
return FtpZOSListRealm.Invalid;
}

// It is a unix like path (starts with /)
if (_LastWorkingDir[0] != '\'') {
return FtpzOSListRealm.Unix;
return FtpZOSListRealm.Unix;
}

// Ok, the CWD starts with a single quoute. Classic z/OS dataset realm
Expand All @@ -72,14 +72,14 @@ public FtpzOSListRealm GetzOSListRealm() {

if (reply.InfoMessages != null &&
reply.InfoMessages.Contains("may be a load library")) {
return FtpzOSListRealm.MemberU;
return FtpZOSListRealm.MemberU;
}

if (reply.Message.Contains("is a partitioned data set")) {
return FtpzOSListRealm.Member;
return FtpZOSListRealm.Member;
}

return FtpzOSListRealm.Dataset;
return FtpZOSListRealm.Dataset;
}

#if ASYNC
Expand All @@ -88,7 +88,7 @@ public FtpzOSListRealm GetzOSListRealm() {
/// current working directory.
/// </summary>
/// <returns>The realm</returns>
public async Task<FtpzOSListRealm> GetzOSListRealmAsync(CancellationToken token = default(CancellationToken))
public async Task<FtpZOSListRealm> GetZOSListRealmAsync(CancellationToken token = default(CancellationToken))
{

// this case occurs immediately after connection and after the working dir has changed
Expand All @@ -99,20 +99,20 @@ public FtpzOSListRealm GetzOSListRealm() {

if (ServerType != FtpServer.IBMzOSFTP ||
ServerOS != FtpOperatingSystem.IBMzOS) {
return FtpzOSListRealm.Invalid;
return FtpZOSListRealm.Invalid;
}

// It is a unix like path (starts with /)
if (_LastWorkingDir[0] != '\'')
{
return FtpzOSListRealm.Unix;
return FtpZOSListRealm.Unix;
}

// Ok, the CWD starts with a single quoute. Classic z/OS dataset realm
FtpReply reply;

// Go to where we are. The reply will tell us what it is we we are...
if (!(reply = await Execute("CWD " + _LastWorkingDir, token)).Success)
if (!(reply = await ExecuteAsync("CWD " + _LastWorkingDir, token)).Success)
{
throw new FtpCommandException(reply);
}
Expand All @@ -123,15 +123,15 @@ public FtpzOSListRealm GetzOSListRealm() {
if (reply.InfoMessages!=null &&
reply.InfoMessages.Contains("may be a load library"))
{
return FtpzOSListRealm.MemberU;
return FtpZOSListRealm.MemberU;
}

if (reply.Message.Contains("is a partitioned data set"))
{
return FtpzOSListRealm.Member;
return FtpZOSListRealm.Member;
}

return FtpzOSListRealm.Dataset;
return FtpZOSListRealm.Dataset;
}
#endif
#endregion
Expand All @@ -142,7 +142,7 @@ public FtpzOSListRealm GetzOSListRealm() {
/// Get z/OS file size
/// </summary>
/// <returns>The size of the file</returns>
public long GetzOSFileSize(string path) {
public long GetZOSFileSize(string path) {
string oldPath = "";
string cwdPath = path;
string[] preFix = path.Split('(');
Expand All @@ -168,15 +168,15 @@ public long GetzOSFileSize(string path) {
/// Get z/OS file size
/// </summary>
/// <returns>The size of the file</returns>
public async Task<long> GetzOSFileSizeAsync(string path, CancellationToken token = default(CancellationToken))
public async Task<long> GetZOSFileSizeAsync(string path, CancellationToken token = default(CancellationToken))
{
string oldPath = "";
string cwdPath = path;
string[] preFix = path.Split('(');
if (preFix.Length > 1) // PDS Member
{
cwdPath = preFix[0] + '\'';
oldPath = await GetWorkingDirectory(token);
oldPath = await GetWorkingDirectoryAsync(token);
await SetWorkingDirectoryAsync(cwdPath, token);
}
ListingParser = FtpParser.IBMzOS;
Expand Down
4 changes: 2 additions & 2 deletions FluentFTP/Client/FtpClient_Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,13 +1111,13 @@ public IPEndPoint SocketRemoteEndPoint {
get => m_stream?.RemoteEndPoint;
}

private FtpzOSListRealm m_zOSListingRealm;
private FtpZOSListRealm m_zOSListingRealm;

/// <summary>
/// During and after a z/OS GetListing(), this value shows the
/// z/OS filesystem realm that was encountered.
/// </summary>
public FtpzOSListRealm zOSListingRealm
public FtpZOSListRealm zOSListingRealm
{
get => m_zOSListingRealm;
set => m_zOSListingRealm = value;
Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Enums/FtpzOSListRealm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace FluentFTP {
/// Flags that can control how a file listing is performed. If you are unsure what to use, set it to Auto.
/// </summary>
[Flags]
public enum FtpzOSListRealm {
public enum FtpZOSListRealm {
/// <summary>
/// Not z/OS Server
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/FluentFTP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\FluentFTP.xml</DocumentationFile>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<Version>35.0.5</Version>
<Version>35.1.0</Version>
<PackageLicenseFile>LICENSE.TXT</PackageLicenseFile>
<PackageIcon>logo-nuget.png</PackageIcon>
</PropertyGroup>
Expand Down
16 changes: 8 additions & 8 deletions FluentFTP/Helpers/Parsers/FtpIBMzOSParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ public static FtpListItem Parse(FtpClient client, string record)
// "total nnnn"
if (record.Contains("total"))
{
client.zOSListingRealm = FtpzOSListRealm.Unix;
client.zOSListingRealm = FtpZOSListRealm.Unix;
return null;
}

// "Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname"
if (record.Contains("Volume Unit"))
{
client.zOSListingRealm = FtpzOSListRealm.Dataset;
client.zOSListingRealm = FtpZOSListRealm.Dataset;
return null;
}

Expand All @@ -67,18 +67,18 @@ public static FtpListItem Parse(FtpClient client, string record)
string[] val = words[5].Split('=');
client.zOSListingLRECL = UInt16.Parse(val[1]);

client.zOSListingRealm = FtpzOSListRealm.Member;
client.zOSListingRealm = FtpZOSListRealm.Member;
return null;
}

// "Name Size TTR Alias-of AC--------- Attributes--------- Amode Rmode"
if (record.Contains("Name Size TTR"))
{
client.zOSListingRealm = FtpzOSListRealm.MemberU;
client.zOSListingRealm = FtpZOSListRealm.MemberU;
return null;
}

if (client.zOSListingRealm == FtpzOSListRealm.Unix)
if (client.zOSListingRealm == FtpZOSListRealm.Unix)
{
// unix mode
//
Expand All @@ -87,7 +87,7 @@ public static FtpListItem Parse(FtpClient client, string record)
return FtpUnixParser.Parse(client, record);
}

if (client.zOSListingRealm == FtpzOSListRealm.Dataset)
if (client.zOSListingRealm == FtpZOSListRealm.Dataset)
{
// PS/PO mode
//
Expand Down Expand Up @@ -123,7 +123,7 @@ public static FtpListItem Parse(FtpClient client, string record)
return null;
}

if (client.zOSListingRealm == FtpzOSListRealm.Member)
if (client.zOSListingRealm == FtpZOSListRealm.Member)
{
// Member mode
//
Expand Down Expand Up @@ -153,7 +153,7 @@ public static FtpListItem Parse(FtpClient client, string record)
return file;
}

if (client.zOSListingRealm == FtpzOSListRealm.MemberU)
if (client.zOSListingRealm == FtpZOSListRealm.MemberU)
{
// Member Loadlib mode
//
Expand Down

0 comments on commit 4e92bb9

Please sign in to comment.