Interface ITempFileProvider
Interface defining a provider that offers services for reading and writing temporary files.
Namespace: SuperOffice.IO
Assembly: SoCore.dll
Syntax
public interface ITempFileProvider
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.Methods
CheckIfFileExists(String)
Check if a named temporary file/storage area exists
Declaration
bool CheckIfFileExists(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | File name to check |
Returns
Type | Description |
---|---|
Boolean | True if such a file exists |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.CreateFile(String)
Create a temporary 'file'
Declaration
string CreateFile(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name to be used for later access. The actual key used by the implementation should also take into account the associate ID, since multiple concurrent users may use the same name, and that does not mean file sharing between users. |
Returns
Type | Description |
---|---|
String |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.DeleteFile(String)
Delete a temporary file
Declaration
void DeleteFile(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name identifying the file. See comments in the CreateFile(String) method for more information on how file names are handled. |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.ReadFileChunk(String, Int64, Byte[])
Read a chunk of data from the file (random access read)
Declaration
int ReadFileChunk(string name, long filePosition, byte[] bufferToUpdate)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name identifying the file. See comments in the CreateFile(String) method for more information on how file names are handled. |
Int64 | filePosition | Position in bytes, starting at 0, to start reading from |
Byte[] | bufferToUpdate | Data buffer to update. The length of this buffer is the maximum number of bytes that will be read |
Returns
Type | Description |
---|---|
Int32 | Actual number of bytes read. If less than the length of the buffer, end-of-file is indicated |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.ReadFileComplete(String)
Make the complete content of the file available as a stream (sequential read)
Declaration
Stream ReadFileComplete(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name identifying the file. See comments in the CreateFile(String) method for more information on how file names are handled. |
Returns
Type | Description |
---|---|
Stream | Stream representing the entire current contents of the file |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.WriteFileChunk(String, Int64, Byte[])
Write a chunk of data to the file (random access write)
Declaration
void WriteFileChunk(string name, long filePosition, byte[] bufferToWriteFrom)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name identifying the file. See comments in the CreateFile(String) method for more information on how file names are handled. |
Int64 | filePosition | Position in bytes, starting at 0, that will be written to |
Byte[] | bufferToWriteFrom | Buffer to write; buffer length determines the size of the write operation |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.WriteFileComplete(String, Stream)
(Over)write - not append - the complete content of the file (sequential write). Any previous content is lost
Declaration
void WriteFileComplete(string name, Stream data)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name identifying the file. See comments in the CreateFile(String) method for more information on how file names are handled. |
Stream | data | Stream to read data from |
Remarks
Temporary files are used in several contexts - when transferring documents in chunks into and out of NetServer; when uploading a document to be saved through the Document dialog, and when handling mails and attachments.
The implementation supplied with NetServer provides these services using temporary files, controlled by the Documents section in the config file with respect to path and impersonation.