Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitry Sikorsky
committed
Nov 26, 2018
1 parent
a295b35
commit 12f4673
Showing
34 changed files
with
1,943 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/ExtCore.FileStorage.Abstractions/Exceptions/AccessDeniedException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents an access denied file storage exception. | ||
/// </summary> | ||
public class AccessDeniedException : FileStorageException | ||
{ | ||
public AccessDeniedException() : base() { } | ||
public AccessDeniedException(string message) : base(message) { } | ||
public AccessDeniedException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ExtCore.FileStorage.Abstractions/Exceptions/DirectoryNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents a directory not found file storage exception. | ||
/// </summary> | ||
public class DirectoryNotFoundException : FileStorageException | ||
{ | ||
public DirectoryNotFoundException() : base() { } | ||
public DirectoryNotFoundException(string message) : base(message) { } | ||
public DirectoryNotFoundException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ExtCore.FileStorage.Abstractions/Exceptions/FileNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents a directory not found file storage exception. | ||
/// </summary> | ||
public class FileNotFoundException : FileStorageException | ||
{ | ||
public FileNotFoundException() : base() { } | ||
public FileNotFoundException(string message) : base(message) { } | ||
public FileNotFoundException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ExtCore.FileStorage.Abstractions/Exceptions/FileStorageException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents a generic file storage exception. | ||
/// </summary> | ||
public class FileStorageException : Exception | ||
{ | ||
public FileStorageException() : base() { } | ||
public FileStorageException(string message) : base(message) { } | ||
public FileStorageException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/ExtCore.FileStorage.Abstractions/Exceptions/PathTooLongException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents a path too long file storage exception. | ||
/// </summary> | ||
public class PathTooLongException : FileStorageException | ||
{ | ||
public PathTooLongException() : base() { } | ||
public PathTooLongException(string message) : base(message) { } | ||
public PathTooLongException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/ExtCore.FileStorage.Abstractions/ExtCore.FileStorage.Abstractions.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Authors>Dmitry Sikorsky</Authors> | ||
<Copyright>Copyright © 2018 Dmitry Sikorsky</Copyright> | ||
<Description>The ExtCore.FileStorage extension component. Based on the ExtCore framework.</Description> | ||
<VersionPrefix>4.0.0-alpha1</VersionPrefix> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<AssemblyName>ExtCore.FileStorage.Abstractions</AssemblyName> | ||
<PackageId>ExtCore.FileStorage.Abstractions</PackageId> | ||
<PackageIconUrl>http://extcore.net/extcore_nuget_icon.png</PackageIconUrl> | ||
<PackageProjectUrl>http://extcore.net/</PackageProjectUrl> | ||
</PropertyGroup> | ||
|
||
</Project> |
31 changes: 31 additions & 0 deletions
31
src/ExtCore.FileStorage.Abstractions/FileStorageOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace ExtCore.FileStorage | ||
{ | ||
/// <summary> | ||
/// Represents generic file storage options. | ||
/// </summary> | ||
public class FileStorageOptions | ||
{ | ||
/// <summary> | ||
/// The origin that is used to connect to the file storage. Might be used to provide an API base URL. | ||
/// </summary> | ||
public string Origin { get; set; } | ||
|
||
/// <summary> | ||
/// The identifier that is used to connect to the file storage. Might be used to provide a username or an application identifier. | ||
/// </summary> | ||
public string Identifier { get; set; } | ||
|
||
/// <summary> | ||
/// The secret that is used to connect to the file storage. Might be used to provide a password, an application secret, or an API key. | ||
/// </summary> | ||
public string Secret { get; set; } | ||
|
||
/// <summary> | ||
/// The root path that is used by the file storage. | ||
/// </summary> | ||
public string RootPath { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Copyright © 2018 Dmitry Sikorsky. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace ExtCore.FileStorage.Abstractions | ||
{ | ||
/// <summary> | ||
/// Describes a generic directory proxy to manipulate an underlying directory with a specified relative path. | ||
/// </summary> | ||
public interface IDirectoryProxy | ||
{ | ||
/// <summary> | ||
/// The path of the underlying directory relatively to the root one. | ||
/// </summary> | ||
string RelativePath { get; } | ||
|
||
/// <summary> | ||
/// Checks if the underlying directory exists. | ||
/// </summary> | ||
/// <returns>Returns a flag indicating if the underlying directory exists.</returns> | ||
Task<bool> ExistsAsync(); | ||
|
||
/// <summary> | ||
/// Creates the underlying directory. | ||
/// </summary> | ||
/// <exception cref="AccessDeniedException"></exception> | ||
/// <exception cref="DirectoryNotFoundException"></exception> | ||
/// <exception cref="PathTooLongException"></exception> | ||
/// <exception cref="FileStorageException"></exception> | ||
Task CreateAsync(); | ||
|
||
/// <summary> | ||
/// Moves the underlying directory. | ||
/// </summary> | ||
/// <param name="destinationRelativePath"></param> | ||
/// <exception cref="ArgumentException"></exception> | ||
/// <exception cref="ArgumentNullException"></exception> | ||
/// <exception cref="AccessDeniedException"></exception> | ||
/// <exception cref="DirectoryNotFoundException"></exception> | ||
/// <exception cref="PathTooLongException"></exception> | ||
/// <exception cref="FileStorageException"></exception> | ||
Task MoveAsync(string destinationRelativePath); | ||
|
||
/// <summary> | ||
/// Deletes the underlying directory. | ||
/// </summary> | ||
/// <param name="recursive">Pass true to remove all the underlying directory content recursively; otherwise false.</param> | ||
/// <exception cref="AccessDeniedException"></exception> | ||
/// <exception cref="DirectoryNotFoundException"></exception> | ||
/// <exception cref="PathTooLongException"></exception> | ||
/// <exception cref="FileStorageException"></exception> | ||
Task DeleteAsync(bool recursive); | ||
|
||
/// <summary> | ||
/// Gets the directory proxies for the directories inside the underlying one. | ||
/// </summary> | ||
/// <returns>The directory proxies for the directories inside the underlying one</returns> | ||
/// <exception cref="AccessDeniedException"></exception> | ||
/// <exception cref="DirectoryNotFoundException"></exception> | ||
/// <exception cref="PathTooLongException"></exception> | ||
/// <exception cref="FileStorageException"></exception> | ||
Task<IEnumerable<IDirectoryProxy>> GetDirectoryProxiesAsync(); | ||
|
||
/// <summary> | ||
/// Gets the file proxies for the files inside the underlying one. | ||
/// </summary> | ||
/// <returns>The file proxies for the files inside the underlying directory.</returns> | ||
/// <exception cref="AccessDeniedException"></exception> | ||
/// <exception cref="DirectoryNotFoundException"></exception> | ||
/// <exception cref="PathTooLongException"></exception> | ||
/// <exception cref="FileStorageException"></exception> | ||
Task<IEnumerable<IFileProxy>> GetFileProxiesAsync(); | ||
} | ||
} |
Oops, something went wrong.