Code Duplication    Length = 6-6 lines in 2 locations

lib/backend.php 1 location

@@ 240-245 (lines=6) @@
237
		$farray = array();
238
		if ($FOLDER != '') {
239
			// Create the folder if it doesn't exist
240
			if (!Filesystem::is_dir($FOLDER)) {
241
				if (!Filesystem::mkdir($FOLDER)) {
242
					\OCP\Util::writeLog('ownnote', 'Could not create ownNote directory.', \OCP\Util::ERROR);
243
					exit;
244
				}
245
			}
246
			// Synchronize files to the database
247
			$filearr = array();
248
			if ($listing = Filesystem::opendir($FOLDER)) {

lib/Service/OwnNoteService.php 1 location

@@ 297-302 (lines=6) @@
294
		$farray = array();
295
		if ($FOLDER != '') {
296
			// Create the folder if it doesn't exist
297
			if (!Filesystem::is_dir($FOLDER)) {
298
				if (!Filesystem::mkdir($FOLDER)) {
299
					\OCP\Util::writeLog('ownnote', 'Could not create ownNote directory.', \OCP\Util::ERROR);
300
					exit;
301
				}
302
			}
303
			// Synchronize files to the database
304
			$filearr = array();
305
			if ($listing = Filesystem::opendir($FOLDER)) {