From 0d4208bd4934d83654fc3893867b2557546b404a Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 18 Jun 2018 14:14:17 +0200 Subject: Add Nextcloud application --- lib/Db/FileOperation.php | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 lib/Db/FileOperation.php (limited to 'lib/Db/FileOperation.php') diff --git a/lib/Db/FileOperation.php b/lib/Db/FileOperation.php new file mode 100644 index 0000000..ea9c40e --- /dev/null +++ b/lib/Db/FileOperation.php @@ -0,0 +1,91 @@ + + * @author Matthias Held + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace OCA\RansomwareDetection\Db; + +use OCP\AppFramework\Db\Entity; + +class FileOperation extends Entity +{ + /** @var string */ + public $userId; + + /** @var string */ + public $path; + + /** @var string */ + public $originalName; + + /** @var string */ + public $newName; + + /** @var string */ + public $type; + + /** @var string */ + public $mimeType; + + /** @var int */ + public $size; + + /** @var int */ + public $corrupted; + + /** @var string */ + public $timestamp; + + /** @var int */ + public $command; + + /** @var int */ + public $sequence; + + /** @var float */ + public $entropy; + + /** @var float */ + public $standardDeviation; + + /** @var float */ + public $fileNameEntropy; + + /** @var string */ + public $fileClass; + + /** @var string */ + public $fileNameClass; + + /** @var int */ + public $suspicionClass; + + public function __construct() + { + // Add types in constructor + $this->addType('size', 'integer'); + $this->addType('corrupted', 'integer'); + $this->addType('command', 'integer'); + $this->addType('sequence', 'integer'); + $this->addType('entropy', 'float'); + $this->addType('standardDeviation', 'float'); + $this->addType('fileNameEntropy', 'float'); + $this->addType('suspicionClass', 'integer'); + } +} -- cgit v1.2.3