using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ScrewTurn.Wiki.PluginFramework {
///
/// Contains information about a file.
///
/// This class is only used for provider-host communication.
public class StFileInfo : FileDetails {
private string fullName;
private IFilesStorageProviderV30 provider;
///
/// Initializes a new instance of the class.
///
/// The size of the file in bytes.
/// The last modification date/time.
/// The download count.
/// The full name of the file, for example /dir/sub/file.txt or /file.txt.
/// The provider that handles the file.
public StFileInfo(long size, DateTime lastModified, int downloadCount, string fullName, IFilesStorageProviderV30 provider)
: base(size, lastModified, downloadCount) {
this.fullName = fullName;
this.provider = provider;
}
///
/// Initializes a new instance of the class.
///
/// The file details.
/// The full name.
/// The provider.
public StFileInfo(FileDetails details, string fullName, IFilesStorageProviderV30 provider)
: this(details.Size, details.LastModified, details.RetrievalCount, fullName, provider) {
}
///
/// Gets the full name of the file, for example /dir/sub/file.txt or /file.txt.
///
public string FullName {
get { return fullName; }
}
///
/// Gets the provider that handles the file.
///
public IFilesStorageProviderV30 Provider {
get { return provider; }
}
///
/// Gets the directory path of the file.
///
/// The directory path.
public string GetDirectory() {
return StDirectoryInfo.GetDirectory(fullName);
}
}
}