Class CPFileSystemBaseClass
- Namespace
- Contensive.BaseClasses
- Assembly
- CPBase.dll
public abstract class CPFileSystemBaseClass
- Inheritance
-
CPFileSystemBaseClass
- Inherited Members
Properties
PhysicalFilePath
The physical file path of the local storage for this resource
public abstract string PhysicalFilePath { get; }
Property Value
Methods
Append(string, string)
Append content to end of a text file
public abstract void Append(string filename, string fileContent)
Parameters
Copy(string, string)
Copy a file within the same filesystem (TempFiles, cndFiles, wwwFiles, privateFiles)
public abstract void Copy(string sourcePathFilename, string destinationPathFilename)
Parameters
Copy(string, string, CPFileSystemBaseClass)
Copy a file to a different filesystem (TempFiles, cndFiles, wwwFiles, privateFiles)
public abstract void Copy(string sourcePathFilename, string destinationPathFilename, CPFileSystemBaseClass destinationFileSystem)
Parameters
sourcePathFilenamestringdestinationPathFilenamestringdestinationFileSystemCPFileSystemBaseClass
CopyLocalToRemote(string)
Copy a file from the local storage to its remote store
public abstract void CopyLocalToRemote(string pathFilename)
Parameters
pathFilenamestring
CopyPath(string, string)
Recursively copy all files in a path to a path the same filesystem (TempFiles, cndFiles, wwwFiles, privateFiles). A path is either blank or begins with a folder name and ends with ''. Valid sample paths are '', 'MyFolder\SubFolder'
public abstract void CopyPath(string sourcePath, string destinationPath)
Parameters
CopyPath(string, string, CPFileSystemBaseClass)
Recursively copy all files in a path to a path in a different filesystem (TempFiles, cndFiles, wwwFiles, privateFiles). A path is either blank or begins with a folder name and ends with ''. Valid sample paths are '', 'MyFolder\SubFolder'
public abstract void CopyPath(string sourcePath, string destinationPath, CPFileSystemBaseClass destinationFileSystem)
Parameters
sourcePathstringdestinationPathstringdestinationFileSystemCPFileSystemBaseClass
CopyRemoteToLocal(string)
Copy a file from the remote storate to its local store.
public abstract void CopyRemoteToLocal(string pathFilename)
Parameters
pathFilenamestringThe path followed by the filename. Path arguments have no leading slash, but they include a trailing slash. ex ParentFolder/SubFolder/Filename.ext
CreateFolder(string)
Create a folder in a path.
public abstract void CreateFolder(string pathFolder)
Parameters
pathFolderstringA path followed by a folder name. (ex ParentFolder/SubFolder/NewFolderName ) Path arguments should have no leading slash.
CreateUniqueFolder()
Create a folder with a unique name. Return the path to the new folder. (Path values have no leading slash, and have a trailing slash, ex NewPath/ )
public abstract string CreateUniqueFolder()
Returns
DeleteFile(string)
Delete a file in a path. Path arguments should have no leading slash. (ex ParentFolder/FileToDelete.txt )
public abstract void DeleteFile(string pathFilename)
Parameters
pathFilenamestring
DeleteFolder(string)
Delete a folder and all files and subfolders. Path arguments should have no leading slash. (ex ParentFolder/FolderToDelete )
public abstract void DeleteFolder(string folderPath)
Parameters
folderPathstring
EncodePathFilename(string)
Change a pathFilename by converting invalid characters to "_". Returns Unix path, but all methods use both Unix and Dos slash. Simple pathFilenames for compatibility with DOS paths and files, Unix and AWS S3 buckets and keys. See isValidPathFilename for description of invalid characters
public abstract string EncodePathFilename(string pathFilename)
Parameters
pathFilenamestringSee IsValidPathFilename for details.
Returns
FileDetails(string)
Get the details of a file. Returns null if the file is not found. Path arguments should have no leading slash. (ex ParentFolder/FileName.ext )
public abstract CPFileSystemBaseClass.FileDetail FileDetails(string PathFilename)
Parameters
PathFilenamestring
Returns
FileExists(string)
Returns true if a file exists in this path
public abstract bool FileExists(string pathFilename)
Parameters
pathFilenamestring
Returns
FileList(string)
public abstract List<CPFileSystemBaseClass.FileDetail> FileList(string folderPath)
Parameters
folderPathstring
Returns
FileList(string, int)
public abstract List<CPFileSystemBaseClass.FileDetail> FileList(string folderPath, int pageSize)
Parameters
Returns
FileList(string, int, int)
Get the details of all files in a folder. Path arguments should have no leading slash. (ex ParentFolder/FolderName )
public abstract List<CPFileSystemBaseClass.FileDetail> FileList(string folderPath, int pageSize, int pageNumber)
Parameters
Returns
FolderExists(string)
Returns true if a folder exists in this path
public abstract bool FolderExists(string folderName)
Parameters
folderNamestring
Returns
FolderList(string)
Get the details of all folders in a path. Path arguments should have no leading slash. (ex ParentFolder )
public abstract List<CPFileSystemBaseClass.FolderDetail> FolderList(string folderPath)
Parameters
folderPathstring
Returns
GetFilename(string)
Returns the path of a pathFilename argument. For example "folder1/folder2/file.txt" returns "file.txt"
public abstract string GetFilename(string pathFilename)
Parameters
pathFilenamestring
Returns
GetPath(string)
Returns the path of a pathFilename argument. For example "folder1/folder2/file.txt" returns "folder1/folder2/"
public abstract string GetPath(string pathFilename)
Parameters
pathFilenamestring
Returns
IsValidPathFilename(string)
Returns true if filename is valid. Paths separated by / or . Simple pathFilenames for compatibility with DOS paths and files, Unix and AWS S3 buckets and keys. Allows 0-9, a-z, A-Z, and "-._"
public abstract bool IsValidPathFilename(string pathFilename)
Parameters
pathFilenamestringpathFilename is the path and filename that are used for all methods, and are relative to the filesystems (cdn,private,temp,www) Path arguments start with a slash, ends with no slash Paths are created with UNIX slash, but accept both slash, / or \
Returns
Read(string)
Read a text file. Path arguments should have no leading slash. (ex ParentFolder/FileToRead.txt )
public abstract string Read(string pathFilename)
Parameters
pathFilenamestring
Returns
ReadBinary(string)
Read a file to a byte array. Path arguments should have no leading slash. (ex ParentFolder/FileToRead.bin )
public abstract byte[] ReadBinary(string pathFilename)
Parameters
pathFilenamestring
Returns
- byte[]
Save(string, string)
Save content to a text file. Path arguments should have no leading slash. (ex ParentFolder/FileToSave.txt )
public abstract void Save(string pathFilename, string fileContent)
Parameters
SaveBinary(string, byte[])
Save a byte array to a file. Path arguments should have no leading slash. (ex ParentFolder/FileToSave.bin )
public abstract void SaveBinary(string pathFilename, byte[] fileContent)
Parameters
SaveHttpGet(string, string)
Get url to a text file
public abstract void SaveHttpGet(string url, string pathFilename)
Parameters
SaveHttpPost(string, string, List<KeyValuePair<string, string>>)
Post key/values to a url and save to text file
public abstract void SaveHttpPost(string url, string pathFilename, List<KeyValuePair<string, string>> requestArguments)
Parameters
SaveHttpPost(string, string, string)
post entity to a url and save to text file
public abstract void SaveHttpPost(string url, string pathFilename, string entity)
Parameters
SaveUpload(string, string, ref string)
Handle a file upload to a path from a submitted post. If successful, return true and the filename.
public abstract bool SaveUpload(string htmlFormName, string folderPath, ref string returnFilename)
Parameters
Returns
SaveUpload(string, ref string)
Handle a file upload from a submitted post to the /upload path. If successful, return true and the filename.
public abstract bool SaveUpload(string htmlformName, ref string returnFilename)
Parameters
Returns
UnzipFile(string)
unzip a zip file to a folder with the same name
public abstract void UnzipFile(string pathFilename)
Parameters
pathFilenamestring
ZipPath(string, string)
Create a zip file and add all the files in a path recursively
public abstract void ZipPath(string archivePathFilename, string path)