Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/siddhi-io/siddhi-io-file

Extension which is used to receive/publish event data from/to file
https://github.com/siddhi-io/siddhi-io-file

extension file io siddhi

Last synced: 2 days ago
JSON representation

Extension which is used to receive/publish event data from/to file

Awesome Lists containing this project

README

        

Siddhi IO File
======================================

[![Jenkins Build Status](https://wso2.org/jenkins/job/siddhi/job/siddhi-io-file/badge/icon)](https://wso2.org/jenkins/job/siddhi/job/siddhi-io-file/)
[![GitHub Release](https://img.shields.io/github/release/siddhi-io/siddhi-io-file.svg)](https://github.com/siddhi-io/siddhi-io-file/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date/siddhi-io/siddhi-io-file.svg)](https://github.com/siddhi-io/siddhi-io-file/releases)
[![GitHub Open Issues](https://img.shields.io/github/issues-raw/siddhi-io/siddhi-io-file.svg)](https://github.com/siddhi-io/siddhi-io-file/issues)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/siddhi-io/siddhi-io-file.svg)](https://github.com/siddhi-io/siddhi-io-file/commits/master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

The **siddhi-io-file extension** is an extension to Siddhi which used to receive/publish event data from/to file. It supports both binary and text formats.

The **siddhi-io-file extension** supports local data storage and also following file protocols for file/folder, read/write operations

- FTP
- SFTP
- SMB
- WebDav

### Examples

#### FTP

**Sink**

```sql
@sink(type='file', @map(type='json'), append='true', file.uri='ftp://bob:password@localhost:21/source/published.json')
define stream BarStream (symbol string, price float, volume long);
```

**Source**

```sql
@source(type='file', mode='line', file.uri='ftp://bob:password@localhost:21/source/published.json', action.after.process='keep', tailing='false', @map(type='json'))
define stream FooStream (symbol string, price float, volume long);
```

#### SFTP

**Sink**

```sql
@sink(type='file', @map(type='json'), append='false', file.system.options='USER_DIR_IS_ROOT:false,AVOID_PERMISSION_CHECK:true', file.uri='sftp://demo:demo@localhost:22/sftp/source/published.json')
define stream BarStream (symbol string, price float, volume long);
```

**Source**

```sql
@source(type='file', mode='line', file.uri='sftp://demo:demo@localhost:22/sftp/source/published.json', action.after.process='keep', tailing='false', file.system.options='USER_DIR_IS_ROOT:false,AVOID_PERMISSION_CHECK:true', @map(type='json'))
define stream FooStream (symbol string, price float, volume long);
```

#### SMB
**Sink**

```sql
@sink(type='file', @map(type='json'), append='true', file.uri='smb://ubuntu:[email protected]/sambashare/source/published.json')
define stream BarStream (symbol string, price float, volume long);
```

**Source**

```sql
@source(type='file', mode='line', file.uri='smb://ubuntu:[email protected]/sambashare/source/published.json', action.after.process='keep', tailing='false', @map(type='json'))
define stream FooStream (symbol string, price float, volume long);
```

#### WebDav
**Sink**

```sql
@sink(type='file', @map(type='json'), append='true', file.uri='webdav://alice:secret1234@localhost/source/published.json')
define stream BarStream (symbol string, price float, volume long);
```

**Source**

```sql
@sink(type='file', @map(type='json'), append='false', file.uri='webdav://alice:secret1234@localhost/source/published.json')
define stream BarStream (symbol string, price float, volume long);
```

For information on Siddhi and it's features refer Siddhi Documentation.

## Download

* Versions 5.x and above with group id `io.siddhi.extension.*` from here.
* Versions 4.x and lower with group id `org.wso2.extension.siddhi.*` from here.

## Latest API Docs

Latest API Docs is 2.0.20.

## Features

* isDirectory *(Function)*



This function checks for a given file path points to a directory



* isExist *(Function)*


This function checks whether a file or a folder exists in a given path



* isFile *(Function)*


This function checks for a given file path points to a file



* lastModifiedTime *(Function)*


Checks for the last modified time for a given file path



* size *(Function)*


This function checks for a given file's size



* archive *(Stream Function)*


Archives files and folders as a zip or in tar format that are available in the given file uri.



* copy *(Stream Function)*


This function performs copying file from one directory to another.



* create *(Stream Function)*


Create a file or a folder in the given location



* delete *(Stream Function)*


Deletes file/files in a particular path



* move *(Stream Function)*


This function performs copying file from one directory to another.



* search *(Stream Function)*


Searches files in a given folder and lists.



* searchInArchive *(Stream Function)*


This.



* unarchive *(Stream Function)*


This function decompresses a given file



* file *(Sink)*


The File Sink component of the 'siddhi-io-fie' extension publishes (writes) event data that is processed within Siddhi to files.
Siddhi-io-file sink provides support to write both textual and binary data into files



* file *(Source)*


The File Source component of the 'siddhi-io-fie' extension allows you to receive the input data to be processed by Siddhi via files. Both text files and binary files are supported.



* fileeventlistener *(Source)*


The 'fileeventlistener' component of the 'siddhi-io-fie' extension allows you to get the details of files that have been created, modified or deleted during execution time.Supports listening to local folder/file paths.


## Dependencies

There are no other dependencies needed for this extension.

## Installation

For installing this extension and to add the dependent jars on various siddhi execution environments refer Siddhi documentation section on adding extensions and jars.

## Support and Contribution

* We encourage users to ask questions and get support via StackOverflow, make sure to add the `siddhi` tag to the issue for better response.

* If you find any issues related to the extension please report them on the issue tracker.

* For production support and other contribution related information refer Siddhi Community documentation.