Skip to content

Commit

Permalink
Merge branch 'develop2'
Browse files Browse the repository at this point in the history
  • Loading branch information
yar229 committed Sep 22, 2020
2 parents 223141e + 1bf9bad commit a44ee1f
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
/// <summary>
/// Î÷èñòêà êîðçèíû
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class CopyCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
/// <summary>
/// Ñîçäàåò äëÿ êàòàëîãà ïðèçíàê, ÷òî ôàéëû â í¸ì áóäóò øèôðîâàòüñÿ
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
/// <summary>
/// Ïàðîëü äëÿ (äå)øèôðîâàíèÿ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class DeleteCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
/// <summary>
/// Join random file from cloud. If you got it - you are biggest f@kn lucker of Universe!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class JoinCommand: SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using YaR.Clouds.Base;
using YaR.Clouds.Base.Repos;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class ListCommand : SpecialCommand
{
Expand All @@ -20,12 +20,14 @@ public ListCommand(Cloud cloud, string path, IList<string> parames) : base(cloud

public override async Task<SpecialCommandResult> Execute()
{
string name = Parames.Count > 0 && !string.IsNullOrWhiteSpace(Parames[0])
? Parames[0]
: ".wdmrc.list.lst";
string target = WebDavPath.Combine(Path, name);


var data = await Cloud.Account.RequestRepo.FolderInfo(RemotePath.Get(Path));
string target = Parames.Count > 0 && !string.IsNullOrWhiteSpace(Parames[0])
? (Parames[0].StartsWith(WebDavPath.Separator) ? Parames[0] : WebDavPath.Combine(Path, Parames[0]))
: Path;

var data = await Cloud.Account.RequestRepo.FolderInfo(RemotePath.Get(target));
string resFilepath = WebDavPath.Combine(Path, data.Name + ".wdmrc.list.lst");

var sb = new StringBuilder();
foreach (var e in Flat(data))
Expand All @@ -36,7 +38,7 @@ public override async Task<SpecialCommandResult> Execute()
$"{e.FullPath}\t{e.Size.DefaultValue}\t{e.CreationTimeUtc:yyyy.MM.dd HH:mm:ss}\t{hash}\t{link}");
}

Cloud.UploadFile(target, sb.ToString());
Cloud.UploadFile(resFilepath, sb.ToString());

return SpecialCommandResult.Success;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class LocalToServerCopyCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class MoveCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class RemoveBadLinksCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using YaR.Clouds.Common;
using YaR.Clouds.Extensions;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class ShareCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using YaR.Clouds.Base.Repos.MailRuCloud;
using YaR.Clouds.Links;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class SharedFolderLinkCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading.Tasks;
using YaR.Clouds.Base;

namespace YaR.Clouds.SpecialCommands
namespace YaR.Clouds.SpecialCommands.Commands
{
public class TestCommand : SpecialCommand
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text.RegularExpressions;
using YaR.Clouds.Base;
using YaR.Clouds.SpecialCommands.Commands;

namespace YaR.Clouds.SpecialCommands
{
Expand Down
4 changes: 2 additions & 2 deletions MailRuCloud/MailRuCloudApi/YaR.Clouds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<TargetFrameworks>netcoreapp3.0;net48</TargetFrameworks>
<RootNamespace>YaR.Clouds</RootNamespace>
<AssemblyName>YaR.Clouds</AssemblyName>
<AssemblyVersion>1.12.0.0</AssemblyVersion>
<FileVersion>1.12.0.0</FileVersion>
<AssemblyVersion>1.12.1.0</AssemblyVersion>
<FileVersion>1.12.1.0</FileVersion>
<Version>$(AssemblyVersion)</Version>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions WDMRC.Console/WDMRC.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<Copyright>[email protected]</Copyright>
<Description>WebDAV emulator for Cloud.mail.ru</Description>
<PackageId>WebDAVCloudMailRu</PackageId>
<AssemblyVersion>1.12.0.0</AssemblyVersion>
<FileVersion>1.12.0.0</FileVersion>
<AssemblyVersion>1.12.1.0</AssemblyVersion>
<FileVersion>1.12.1.0</FileVersion>
<Version>$(AssemblyVersion)</Version>
<AssemblyName>wdmrc</AssemblyName>
<RootNamespace>YaR.Clouds.Console</RootNamespace>
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Parameters with spaces must be screened by quotes.
* `>>move` `/full/path/from /full/path/to` Fast move (if your client moves inner items recursively)
* `>>copy` `/full/path/from /full/path/to` Fast copy (if your client copies inner items recursively)
* `>>lcopy` `x:/local/path/from /full/server/path/to` If file already in cloud, add it by hash without uploading
* `>>rlist` [[/]path] [list_filename] list [path] to [list_filename]
* `>>del [[/]path]` Fast delete (if your client makes recursive deletions of inner items)
* `>>share [[/]path]` Make file/folder public <br/>
- and create `.share.wdmrc` file with links
Expand Down

0 comments on commit a44ee1f

Please sign in to comment.