apps/files_external/lib/Lib/Api.php
/**
	 * Formats the given mount config to a mount entry.
	 *
	 * @param string $mountPoint mount point name, relative to the data dir
	 * @param array $mountConfig mount config to format
	 *
	 * @return array entry
	 */
Formats the given mount config to a mount entry.
@param string $mountPoint mount point name, relative to the data dir
@param array $mountConfig mount config to format

@return array entry
Formats the given mount config to a mount entry . @param string $mountPoint mount point name relative to the data dir @param array $mountConfig mount config to format @return array entry
private static function formatMount($mountPoint, $mountConfig) {
		$mountPoint = explode('/', trim($mountPoint, '/'), 3);
		$mountPoint = $mountPoint[2];
		$path = dirname($mountPoint);
		if ($path === '.') {
			$path = '';
		}
		$isSystemMount = !$mountConfig['personal'];
		$permissions = \OCP\Constants::PERMISSION_READ;
		if (!$isSystemMount) {
			$permissions |= \OCP\Constants::PERMISSION_DELETE;
		}
		$entry = array(
			'name' => basename($mountPoint),
			'path' => $path,
			'type' => 'dir',
			'backend' => $mountConfig['backend'],
			'scope' => ( $isSystemMount ? 'system' : 'personal' ),
			'permissions' => $permissions,
			'id' => $mountConfig['id'],
			'class' => $mountConfig['class']
		);
		return $entry;
	}
private static function formatMount ( $ mountPoint , $ mountConfig ) { $ mountPoint = explode ( '/' , trim ( $ mountPoint , '/' ) , 3 ) ; $ mountPoint = $ mountPoint [ 2 ] ; $ path = dirname ( $ mountPoint ) ; if ( $ path === '.' ) { $ path = '' ; } $ isSystemMount = ! $ mountConfig [ 'personal' ] ; $ permissions = \ OCP \ Constants :: PERMISSION_READ ; if ( ! $ isSystemMount ) { $ permissions |= \ OCP \ Constants :: PERMISSION_DELETE ; } $ entry = array ( 'name' => basename ( $ mountPoint ) , 'path' => $ path , 'type' => 'dir' , 'backend' => $ mountConfig [ 'backend' ] , 'scope' => ( $ isSystemMount ? 'system' : 'personal' ) , 'permissions' => $ permissions , 'id' => $ mountConfig [ 'id' ] , 'class' => $ mountConfig [ 'class' ] ) ; return $ entry ; }
Formats the given mount config to a mount entry.
Formats the given mount config to a mount entry .
// strip "/$user/files" from mount point // split path from mount point // personal mounts can be deleted