Resource Management
ByteHide Storage provides tools to help you manage and organize your stored resources efficiently.
Listing Resources
List files in a directory:
// List files in root directory
var files = await storage.ListAsync("/");
// List files in specific directory
var images = await storage.ListAsync("images/2024");
// List files recursively
var allFiles = await storage.ListAsync("/", recursive: true);
Resource Information
Get information about stored files:
// Get file information
var fileInfo = await storage.GetInfoAsync("documents/report.pdf");
// Check file properties
Console.WriteLine($"Size: {fileInfo.Size}");
Console.WriteLine($"Last Modified: {fileInfo.LastModified}");
Console.WriteLine($"Is Encrypted: {fileInfo.IsEncrypted}");
Console.WriteLine($"Is Compressed: {fileInfo.IsCompressed}");
Resource Organization
Organize your resources using directories:
// Work with specific directory
var docsStorage = storage.In("documents");
// Create nested structure
storage
.In("images/products/2024")
.FromFile("photo.jpg", "local/photo.jpg");
Best Practices
- Use consistent naming conventions
- Organize files by type and purpose
- Keep directory structures shallow when possible