Code Duplication    Length = 12-13 lines in 2 locations

apps/files_external/lib/Lib/Storage/Google.php 2 locations

@@ 197-208 (lines=12) @@
194
	 * @return string
195
	 */
196
	private function getGoogleDocExtension($mimetype) {
197
		if ($mimetype === self::DOCUMENT) {
198
			return 'odt';
199
		} else if ($mimetype === self::SPREADSHEET) {
200
			return 'ods';
201
		} else if ($mimetype === self::DRAWING) {
202
			return 'jpg';
203
		} else if ($mimetype === self::PRESENTATION) {
204
			// Download as .odp is not available
205
			return 'pdf';
206
		} else {
207
			return '';
208
		}
209
	}
210
211
	public function mkdir($path) {
@@ 581-593 (lines=13) @@
578
			// Convert Google Doc mimetypes, choosing Open Document formats for download
579
			if ($mimetype === self::FOLDER) {
580
				return 'httpd/unix-directory';
581
			} else if ($mimetype === self::DOCUMENT) {
582
				return 'application/vnd.oasis.opendocument.text';
583
			} else if ($mimetype === self::SPREADSHEET) {
584
				return 'application/x-vnd.oasis.opendocument.spreadsheet';
585
			} else if ($mimetype === self::DRAWING) {
586
				return 'image/jpeg';
587
			} else if ($mimetype === self::PRESENTATION) {
588
				// Download as .odp is not available
589
				return 'application/pdf';
590
			} else {
591
				// use extension-based detection, could be an encrypted file
592
				return parent::getMimeType($path);
593
			}
594
		} else {
595
			return false;
596
		}