forked from smartstore/SmartStoreNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIFile.cs
More file actions
72 lines (59 loc) · 1.47 KB
/
Copy pathIFile.cs
File metadata and controls
72 lines (59 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
namespace SmartStore.Core.IO
{
public interface IFile
{
/// <summary>
/// The path relative to the storage root
/// </summary>
string Path { get; }
/// <summary>
/// The path without the file part, but with trailing slash
/// </summary>
string Directory { get; }
/// <summary>
/// File name including extension
/// </summary>
string Name { get; }
/// <summary>
/// File name excluding extension
/// </summary>
string Title { get; }
/// <summary>
/// Size in bytes
/// </summary>
long Size { get; }
/// <summary>
/// Expressed as UTC time
/// </summary>
DateTime LastUpdated { get; }
/// <summary>
/// File extension including dot
/// </summary>
string Extension { get; }
/// <summary>
/// Dimensions, if the file is an image.
/// </summary>
Size Dimensions { get; }
bool Exists { get; }
/// <summary>
/// Creates a stream for reading from the file.
/// </summary>
Stream OpenRead();
/// <summary>
/// Creates a stream for writing to the file.
/// </summary>
Stream OpenWrite();
/// <summary>
/// Creates a stream for writing to the file, and truncates the existing content.
/// </summary>
Stream CreateFile();
/// <summary>
/// Asynchronously creates a stream for writing to the file, and truncates the existing content.
/// </summary>
Task<Stream> CreateFileAsync();
}
}