IO functions
AppendToLocalFile
Declaration
void AppendToLocalFile(string name, string content)
Description
Appends text to a local file. If the file does not exist, it will be created.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to append content to.
|
content
|
The content to be appended to the file.
|
Return Value
Does not return a value.
AppendToLocalFile
Declaration
void AppendToLocalFile(string name, string content, string encoding)
Description
Appends text to a local file. If the file does not exist, it will be created.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to append content to.
|
content
|
The content to be appended to the file.
|
encoding
|
The encoding of the content to be appended.
|
Return Value
Does not return a value.
CreateLocalFile
Declaration
void CreateLocalFile(string name)
Description
Creates a new file.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to be created.
|
Return Value
Does not return a value.
CreateRepositoryConnection
Declaration
RepositoryConnection CreateRepositoryConnection(string repository, string project, string user, string password)
Description
Not supported anymore, throws an error. Original behavior: Creates a connection to a repository using password authentication.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repository
|
Name of the repository, no longer needed and thus ignored.
|
project
|
Name of the project in the repository.
|
user
|
User name to be used for repository connection.
|
password
|
Password to be used for repository connection.
|
Return Value
Connection to a repository as specified by the connection parameters.
CreateRepositoryConnection
Declaration
RepositoryConnection CreateRepositoryConnection(string repository, string project, string ticket)
Description
Not supported anymore, throws an error. Original behavior: Creates a connection to a repository using ticket authentication.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repository
|
Name of the repository, no longer needed and thus ignored.
|
project
|
Name of the project in the repository.
|
ticket
|
Ticket to be used for authentication.
|
Return Value
Connection to a repository as specified by the connection parameters.
CreateRepositoryConnectionExisting
Declaration
RepositoryConnection CreateRepositoryConnectionExisting()
Description
Creates a connection to a repository using ticket authentication.
Supported Runtime Versions
5.0
Parameters
The function has no parameters.
Return Value
Connection to a repository as specified by the connection parameters.
DeleteLocalFile
Declaration
void DeleteLocalFile(string fileName)
Description
Deletes a local file. If it fails, an exception is thrown.
Supported Runtime Versions
5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
fileName
|
Name of the file to be deleted.
|
Return Value
Does not return a value.
GetCOSTicket
Declaration
string GetCOSTicket(RepositoryConnection connection)
Description
Gets a COS ticket from a certain repository connection.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
connection
|
Repository connection to get a COS ticket from.
|
Return Value
The connection's COS ticket.
LocalFileExists
Declaration
bool LocalFileExists(string name)
Description
Checks if a given file exists.
Supported Runtime Versions
5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to check.
|
Return Value
Returns true if the file exists.
LocalGetFileLength
Declaration
double LocalGetFileLength(string name)
Description
Gets the size of a given file.
Supported Runtime Versions
5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to check.
|
Return Value
File size value.
ParseCsvDocument
Declaration
StringListList ParseCsvDocument(string csvDocument, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues, int skipLines, IntArray selectColumns)
Description
Parses a string containing CSV data and returns its content.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
csvDocument
|
The string to be parsed.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
skipLines
|
Sets the number of lines to be ignored at the beginning of the CSV file.
|
selectColumns
|
Specifies the indices of the columns to be returned.
|
Return Value
The content of the CSV string.
ParseCsvDocument
Declaration
StringListList ParseCsvDocument(string csvDocument)
Description
Parses a string containing CSV data and returns its content. This function uses default values for the CSV parser: Separator is ",", quote character is ", quote escape character is ", fields should be quoted, quotes will not be returned.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
csvDocument
|
The string to be parsed.
|
Return Value
The content of the CSV string.
ParseCsvDocument
Declaration
StringListList ParseCsvDocument(string csvDocument, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues)
Description
Parses a string containing CSV data and returns its content.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
csvDocument
|
The string to be parsed.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
Return Value
The content of the CSV file.
ReadFile
Declaration
string ReadFile(string url, string encoding)
Description
Reads a file from an URL. The encoding is automatically detected based on the file BOM. If the detection fails, the encoding provided by user is used.
Supported Runtime Versions
4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
url
|
Location of the file to be read.
|
encoding
|
The encoding used if encoding autodetection fails.
|
Return Value
The file's content.
ReadFile
Declaration
string ReadFile(string url)
Description
Reads a file from an URL. The encoding is automatically detected based on the file BOM. If the detection fails, the encoding for operating system's current code page is used.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
url
|
Location of the file to be read.
|
Return Value
The file's content.
ReadLocalFile
Declaration
string ReadLocalFile(string name)
Description
Reads a file from a local file system. The encoding is automatically detected based on the file BOM. If the detection fails, UTF-8 encoding is used.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to be read.
|
Return Value
The file's content.
ReadLocalFile
Declaration
string ReadLocalFile(string name, string encoding)
Description
Reads a file from a local file system. The encoding is automatically detected based on the file BOM. If the detection fails, the encoding provided by user is used.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to be read.
|
encoding
|
The encoding used if encoding autodetection fails.
|
Return Value
The file's content.
RepositoryCreateFile
Declaration
string RepositoryCreateFile(RepositoryConnection repositoryConnection, string attachmentName, string content)
Description
Creates a new attachment for a repository project. The content is written in UTF-8 encoding.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project.
|
attachmentName
|
Name of the attachment to be created.
|
content
|
The content of the attachment.
|
Return Value
Id of newly created attachment.
RepositoryDeleteFile
Declaration
bool RepositoryDeleteFile(RepositoryConnection repositoryConnection, string attachmentId)
Description
Deletes an attachment from a repository project.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project.
|
attachmentId
|
ID of the attachment to be deleted.
|
Return Value
True, if the attachment could be deleted. False, if it could not be deleted.
RepositoryDisconnect
Declaration
void RepositoryDisconnect(RepositoryConnection connection)
Description
Disconnects a certain repository connection.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
connection
|
Repository connection to be disconnected.
|
Return Value
Does not return a value.
RepositoryFileExists
Declaration
bool RepositoryFileExists(RepositoryConnection repositoryConnection, string attachmentId)
Description
Checks if the given repository file exists.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to check the file.
|
attachmentId
|
ID of the file to be checked.
|
Return Value
Returns true if the file exists.
RepositoryGetFileLength
Declaration
double RepositoryGetFileLength(RepositoryConnection repositoryConnection, string attachmentId)
Description
Gets the size of a given repository file.
Supported Runtime Versions
5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to check the file.
|
attachmentId
|
ID of the file to be checked.
|
Return Value
File size value.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues, int skipLines, IntArray selectColumns)
Description
Reads a CSV file from a repository project and returns its content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
skipLines
|
Sets the number of lines to be ignored at the beginning of the CSV file.
|
selectColumns
|
Specifies the indices of the columns to be returned.
|
Return Value
The content of the CSV file.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId)
Description
Reads a CSV file from a repository project and returns its content. This function uses default values for the CSV parser: Separator is ",", quote character is ", quote escape character is ", fields should be quoted, quotes will not be returned. The UTF-8 encoding is used to read the content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
Return Value
The content of the CSV file.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues)
Description
Reads a CSV file from a repository project and returns its content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
Return Value
The content of the CSV file.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId, string encoding)
Description
Reads a CSV file from a repository project and returns its content. This function uses default values for the CSV parser: Separator is ",", quote character is ", quote escape character is ", fields should be quoted, quotes will not be returned.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
encoding
|
The encoding used to read the file.
|
Return Value
The content of the CSV file.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId, string encoding, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues)
Description
Reads a CSV file from a repository project and returns its content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
encoding
|
The encoding used to read the file.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
Return Value
The content of the CSV file.
RepositoryReadCsvFile
Declaration
StringListList RepositoryReadCsvFile(RepositoryConnection repositoryConnection, string attachmentId, string encoding, string separator, string quoteChar, string quoteEscChar, bool useQuotes, bool unquoteValues, int skipLines, IntArray selectColumns)
Description
Reads a CSV file from a repository project and returns its content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the CSV file from.
|
attachmentId
|
ID of the file to be read.
|
encoding
|
The encoding used to read the file.
|
separator
|
The character used for separating fields in the CSV file.
|
quoteChar
|
The character used for quoting single fields in the CSV file.
|
quoteEscChar
|
The character used for escaping the quote character when it occurs in a value.
|
useQuotes
|
Determines whether fields should be quoted (true) or not (false).
|
unquoteValues
|
Determines whether quotes around fields should be returned (false) or not (true).
|
skipLines
|
Sets the number of lines to be ignored at the beginning of the CSV file.
|
selectColumns
|
Specifies the indices of the columns to be returned.
|
Return Value
The content of the CSV file.
RepositoryReadFile
Declaration
string RepositoryReadFile(RepositoryConnection repositoryConnection, string attachmentId)
Description
Reads a file from a repository project and returns its content. The UTF-8 encoding is used to read the content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the file from.
|
attachmentId
|
ID of the file to be read.
|
Return Value
The file's content.
RepositoryReadFile
Declaration
string RepositoryReadFile(RepositoryConnection repositoryConnection, string attachmentId, string encoding)
Description
Reads a file from a repository project and returns its content.
Supported Runtime Versions
4.0, 5.0
Parameters
|
Description
|
---|---|
repositoryConnection
|
Repository connection that points to the project to read the file from.
|
attachmentId
|
ID of the file to be read.
|
encoding
|
The encoding used to read the content.
|
Return Value
The file's content.
WriteLocalFile
Declaration
void WriteLocalFile(string name, string content)
Description
Writes a file to a local file system.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to be written.
|
content
|
Content of the file to be written.
|
Return Value
Does not return a value.
WriteLocalFile
Declaration
void WriteLocalFile(string name, string content, string encoding)
Description
Writes a file to a local file system and applies a certain encoding to its content.
Supported Runtime Versions
3.0, 4.0, 5.0
This function is not supported in a cloud environment.
Parameters
|
Description
|
---|---|
name
|
Name of the file to be written.
|
content
|
Content of the file to be written.
|
encoding
|
The encoding of the file to be written.
|
Return Value
Does not return a value.