Service File
from file import File
| Port Name | Location | Protocol | Interfaces |
|---|---|---|---|
| ip | local | FileInterface |
List of Available Interfaces
FileInterface
| Operation Name | Input Type | Output Type | Faults | Description |
|---|---|---|---|---|
| convertFromBase64ToBinaryValue | string | raw | IOException3#IOExceptionType | deprecated, please use base64ToRaw@Converter()() from converter.iol |
| convertFromBinaryToBase64Value | raw | string | - | deprecated, please use rawToBase64@Converter()() from converter.iol |
| copyDir | CopyDirRequest | bool | FileNotFoundundefinedIOExceptionundefined | it copies a source directory into a destination one |
| delete | DeleteRequest | bool | IOException3#IOExceptionType | |
| deleteDir | string | bool | IOException3#IOExceptionType | it deletes a directory recursively removing all its contents |
| exists | string | bool | - | it tests if the specified file or directory exists or not. |
| getFileSeparator | void | string | - | |
| getMimeType | string | string | FileNotFoundFileNotFoundType | |
| getParentPath | string | string | InvalidPathException0#JavaExceptionType | Constructs the path to the parent directory. Can be used to construct paths that does not exist so long as the path uses the system's filesystem path conventions. Throws a InvalidPathException fault if input path is not a recognized system path or if the parent has no parent. |
| getRealServiceDirectory | void | string | IOException3#IOExceptionType | Returns the real filesystem directory (following links) from which the service has been launched |
| getRealServiceFileName | void | string | IOException3#IOExceptionType | Returns the name of the real file (following links) from which the service has been launched |
| getServiceDirectory | void | string | IOException3#IOExceptionType | Returns the filesystem directory from which the service has been launched |
| getServiceFileName | void | string | - | Returns the name of the file from which the service has been launched |
| getServiceParentPath | void | string | - | Returns the parent path of the service |
| getSize | any | int | - | The size of any basic type variable. - raw: buffer size - void: 0 - boolean: 1 - integer types: int 4, long 8 - double: 8 - string: size in the respective platform encoding, on ASCII and latin1 equal to the string's length, on Unicode (UTF-8 etc.) >= string's length |
| isDirectory | string | bool | FileNotFoundFileNotFoundTypeIOException3#IOExceptionType | it returns if a filename is a directory or not. False if the file does not exist. |
| list | ListRequest | ListResponse | IOException3#IOExceptionType | |
| mkdir | string | bool | - | it creates the directory specified in the request root. Returns true if the directory has been created with success, false otherwise |
| readFile | ReadFileRequest | undefined | FileNotFoundFileNotFoundTypeIOException3#IOExceptionType | Reads some file's content into a Jolie structure Supported formats (ReadFileRequest.format): - text (the default) - base64 (same as binary but afterwards base64-encoded) - binary - xml - xml_store (a type-annotated XML format) - properties (Java properties file) - json Child values: text, base64 and binary only populate the return's base value, the other formats fill in the child values as well. - xml, xml_store: the XML root node will costitute a return's child value, the rest is filled in recursively - properties: each property is represented by a child value - json: each attribute corresponds to a child value, the default values (attribute "$" or singular value) are saved as the base values, nested arrays get mapped with the "" helper childs (e.g. a[i][j] -> a.[i]._[j]), the rest is filled in recursively |
| rename | RenameRequest | void | IOException3#IOExceptionType | |
| setMimeTypeFile | string | void | IOException3#IOExceptionType | |
| toAbsolutePath | string | string | InvalidPathException0#JavaExceptionType | Constructs an absolute path to the target file or directory. Can be used to construct an absolute path for new files that does not exist yet. Throws a InvalidPathException fault if input is a relative path is not system recognized path. |
| writeFile | WriteFileRequest | void | FileNotFoundFileNotFoundTypeIOException3#IOExceptionType | Writes a Jolie structure out to an external file Supported formats (WriteFileRequest.format): - text (the default if base value not of type raw) - binary (the default if base value of type raw) - xml - xml_store (a type-annotated XML format) - json Child values: text and binary only consider the content's (WriteFileRequest.content) base value, the other formats look at the child values as well. - xml, xml_store: the XML root node will costitute the content's only child value, the rest gets read out recursively - json: each child value corresponds to an attribute, the base values are saved as the default values (attribute "$" or singular value), the "" helper childs disappear (e.g. a.[i]._[j] -> a[i][j]), the rest gets read out recursively when format is xml and a schema is defined, the resulting xml follows the schema constraints. Use "@NameSpace" in order to enable root element identification in the schema by specifing the namespace of the root. Use "@Prefix" for forcing a prefix in an element. Use "@ForceAttribute" for forcing an attribute in an element even if it is not defined in the corresponding schema |
Types
CopyDirRequest: from: the source directory to copy to: the target directory to copy into
Type Declaration
void {
from[1,1]: string //
to[1,1]: string //
}
ListRequest:
Type Declaration
void {
regex[0,1]: string //
dirsOnly[0,1]: bool //
directory[1,1]: string //
recursive[0,1]: bool //
order[0,1]: void {
byname[0,1]: bool //
} //
info[0,1]: bool //
}
ListResponse:
Type Declaration
void {
result[0,1]: string {
info[0,1]: void {
size[1,1]: long //
absolutePath[1,1]: string //
lastModified[1,1]: long //
isDirectory[1,1]: bool //
isHidden[1,1]: bool //
} //
} //
}
ReadFileRequest:
Type Declaration
void {
filename[1,1]: string //
format[0,1]: string {
skipMixedText[0,1]: bool //
charset[0,1]: string //
stream[0,1]: bool // if format is "yaml" and this is true, the file is read as a stream of multiple YAML documents which will be returned as a "documents" array in the response
} //
}
WriteFileRequest:
Type Declaration
void {
filename[1,1]: string //
format[0,1]: string {
schema[0,1]: string //
indent[0,1]: bool //
doctype_system[0,1]: string //
encoding[0,1]: string //
} //
content[1,1]: undefined //
append[0,1]: int //
}