Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yar229 committed Dec 10, 2016
2 parents 7f1b25d + 2525c25 commit c7e6d80
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 69 deletions.
59 changes: 10 additions & 49 deletions WDMRC.Console/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
<section name="FooConsole.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>

<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>

</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>


<log4net>
Expand Down Expand Up @@ -48,54 +44,19 @@
<level value="ALL"/>
<appender-ref ref="ColoredConsoleAppender"/>
</root>

</log4net>


<applicationSettings>
<FooConsole.Properties.Settings>
<setting name="z" serializeAs="String">
<value>z</value>
</setting>


</FooConsole.Properties.Settings>
</applicationSettings>


<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
<arg key="level" value="ALL" />
<arg key="showLogName" value="true" />
<arg key="showDataTime" value="true" />
<arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
</factoryAdapter>
</logging>
</common>


<FooConsole.Properties.Settings>
<setting name="z" serializeAs="String">
<value>z</value>
</setting>
</FooConsole.Properties.Settings>
</applicationSettings>

<runtime>


<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">


<dependentAssembly>


<assemblyIdentity name="Common.Logging.Core" publicKeyToken="af08829b84f0328e" culture="neutral" />


<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />


</dependentAssembly>


</assemblyBinding>


</runtime>
</configuration>
9 changes: 0 additions & 9 deletions WDMRC.Console/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions WDMRC.Console/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="FooConsole.Properties" GeneratedClassName="Settings">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles />
<Settings>
<Setting Name="z" Type="System.String" Scope="Application">
<Value Profile="(Default)">z</Value>
</Setting>
</Settings>
<Settings />
</SettingsFile>
12 changes: 11 additions & 1 deletion WebDavMailRuCloudStore/Mailru/StoreBase/MailruStoreCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,17 @@ public Task<StoreCollectionResult> CreateCollectionAsync(string name, bool overw
return Task.FromResult(new StoreCollectionResult(DavStatusCode.PreconditionFailed));

// Determine the destination path
var destinationPath = Path.Combine(FullPath, name).Replace("\\", "/");
//var destinationPath = Path.Combine(FullPath, name).Replace("\\", "/");
var destinationPath = WebDAVPath.Combine(FullPath, name);


var cmd = new SpecialCommand(destinationPath);
if (cmd.IsCommand)
{
bool k = Cloud.Instance.CloneItem(cmd.Path, cmd.Value).Result;
return Task.FromResult(new StoreCollectionResult(k ? DavStatusCode.Created : DavStatusCode.PreconditionFailed));
}


DavStatusCode result;

Expand Down
29 changes: 29 additions & 0 deletions WebDavMailRuCloudStore/WebDAVPath.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace YaR.WebDavMailRu.CloudStore
{
public static class WebDAVPath
{
public static string Combine(string a, string b)
{
a = Clean(a);
b = Clean(b);
a = a.Trim('/');
b = b.TrimStart('/');
string res = "/" + a + (string.IsNullOrEmpty(b) ? "" : "/" + b);
return res;

}

public static string Clean(string path)
{
return path.Replace("\\", "/");
}

}
}
1 change: 1 addition & 0 deletions WebDavMailRuCloudStore/WebDavMailRuCloudStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<Compile Include="Mailru\StoreBase\IMailruStoreItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SeekableAesStream.cs" />
<Compile Include="WebDAVPath.cs" />
<Compile Include="XTSSharp\RandomAccessSectorStream.cs" />
<Compile Include="XTSSharp\SectorStream.cs" />
<Compile Include="XTSSharp\Xts.cs" />
Expand Down
11 changes: 8 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
--help Display this help screen.
--version Display version information.
```

Clone shared cloud.mail.ru file/folder to your account:<br>
make folder with name '>>SHARED_FOLDER_LINK'

**Windows**

Use as Windows disk: <br>
```
net use <disk>: http://127.0.0.1:<port>
Expand All @@ -28,12 +34,10 @@ By default, Windows limits file size to 5000000 bytes, you can increase it up to
* Click on Decimal
* In the Value data box, type 4294967295, and then click OK.

[Wrong disk size when mapped as Windows drive](https://support.microsoft.com/en-us/kb/2386902)
[Wrong disk size when mapped as Windows drive](https://support.microsoft.com/en-us/kb/2386902)<br>
Microsoft says - "It's not a bug, it's by design"


Bad news: Total Commander [WebDAV plugin](http://www.ghisler.com/plugins.htm) does not work... ([sources](http://ghisler.fileburst.com/fsplugins/webdav_src.zip) found occasionally, but no time...)

**Big thanks** to
* [Ramon de Klein](https://github.com/ramondeklein) for [nwebdav server](https://github.com/ramondeklein/nwebdav)
* [Erast Korolev](https://github.com/erastmorgan) for [Mail.Ru.net-cloud-client](https://github.com/erastmorgan/Mail.Ru-.net-cloud-client)
Expand All @@ -42,5 +46,6 @@ Bad news: Total Commander [WebDAV plugin](http://www.ghisler.com/plugins.htm) do

**Remarks**
* [How to compile for Linux](https://toster.ru/q/375448) from [Алексей Немиро](https://toster.ru/user/AlekseyNemiro) (yep, I'm lazy ass...)
* Bad news: Total Commander [WebDAV plugin](http://www.ghisler.com/plugins.htm) does not work... ([sources](http://ghisler.fileburst.com/fsplugins/webdav_src.zip) found occasionally, but no time...)
* Avoid using #, %, + in file and folder names
* If you have paid account - you can remove 2Gb filesize limitation using `--user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17/TCWFX(x64)"` (taken from [pozitronik/CloudMailRu]( https://github.com/pozitronik/CloudMailRu), no any guarantees, speed limit may exist)

0 comments on commit c7e6d80

Please sign in to comment.