Code Duplication    Length = 10-13 lines in 2 locations

lib/private/Preview/Watcher.php 2 locations

@@ 54-66 (lines=13) @@
51
		$this->appData = $appData;
52
	}
53
54
	public function postWrite(Node $node) {
55
		// We only handle files
56
		if ($node instanceof Folder) {
57
			return;
58
		}
59
60
		try {
61
			$folder = $this->appData->getFolder($node->getId());
62
			$folder->delete();
63
		} catch (NotFoundException $e) {
64
			//Nothing to do
65
		}
66
	}
67
68
	public function preDelete(Node $node) {
69
		// To avoid cycles
@@ 88-97 (lines=10) @@
85
		}
86
	}
87
88
	public function postDelete(Node $node) {
89
		foreach ($this->toDelete as $fid) {
90
			try {
91
				$folder = $this->appData->getFolder($fid);
92
				$folder->delete();
93
			} catch (NotFoundException $e) {
94
				// continue
95
			}
96
		}
97
	}
98
}
99