apps/files/lib/Controller/ViewController.php
/**
	 * Redirects to the file list and highlight the given file id
	 *
	 * @param string $fileId file id to show
	 * @return RedirectResponse redirect response or not found response
	 * @throws \OCP\Files\NotFoundException
	 */
Redirects to the file list and highlight the given file id
@param string $fileId file id to show
@return RedirectResponse redirect response or not found response
@throws \OCP\Files\NotFoundException
Redirects to the file list and highlight the given file id @param string $fileId file id to show @return RedirectResponse redirect response or not found response @throws \ OCP \ Files \ NotFoundException
private function showFile($fileId) {
		$uid = $this->userSession->getUser()->getUID();
		$baseFolder = $this->rootFolder->getUserFolder($uid);
		$files = $baseFolder->getById($fileId);
		$params = [];
		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
			$baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
			$files = $baseFolder->getById($fileId);
			$params['view'] = 'trashbin';
		}
		if (!empty($files)) {
			$file = current($files);
			if ($file instanceof Folder) {
				$params['dir'] = $baseFolder->getRelativePath($file->getPath());
			} else {
				$params['dir'] = $baseFolder->getRelativePath($file->getParent()->getPath());
				$params['scrollto'] = $file->getName();
			}
			return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index', $params));
		}
		throw new \OCP\Files\NotFoundException();
	}
private function showFile ( $ fileId ) { $ uid = $ this -> userSession -> getUser ( ) -> getUID ( ) ; $ baseFolder = $ this -> rootFolder -> getUserFolder ( $ uid ) ; $ files = $ baseFolder -> getById ( $ fileId ) ; $ params = [ ] ; if ( empty ( $ files ) && $ this -> appManager -> isEnabledForUser ( 'files_trashbin' ) ) { $ baseFolder = $ this -> rootFolder -> get ( $ uid . '/files_trashbin/files/' ) ; $ files = $ baseFolder -> getById ( $ fileId ) ; $ params [ 'view' ] = 'trashbin' ; } if ( ! empty ( $ files ) ) { $ file = current ( $ files ) ; if ( $ file instanceof Folder ) { $ params [ 'dir' ] = $ baseFolder -> getRelativePath ( $ file -> getPath ( ) ) ; } else { $ params [ 'dir' ] = $ baseFolder -> getRelativePath ( $ file -> getParent ( ) -> getPath ( ) ) ; $ params [ 'scrollto' ] = $ file -> getName ( ) ; } return new RedirectResponse ( $ this -> urlGenerator -> linkToRoute ( 'files.view.index' , $ params ) ) ; } throw new \ OCP \ Files \ NotFoundException ( ) ; }
Redirects to the file list and highlight the given file id
 @param string $fileId file id to show
 @return RedirectResponse redirect response or not found response
 @throws \OCP\Files\NotFoundException
Redirects to the file list and highlight the given file id @param string $fileId file id to show @return RedirectResponse redirect response or not found response @throws \ OCP \ Files \ NotFoundException
// set the full path to enter the folder // set parent path as dir // and scroll to the entry