获取原图
@param string $file_id
@return string
495221
public function getUrl($file_id){
        $path=$this->config['base_path'].DIRECTORY_SEPARATOR;
        return $this->config['cdn'].$path.$file_id;
    }
435769
def get_file_by_id(self, file_id):
        
        return self._create_item_response(
            self.data_service.get_file(file_id),
            File
        )
597977
public function read($session_id)
    {
        $session = $this->sessions()
            ->where('id', $session_id)->first();

        if (is_null($session)) {
            return '';
        }

        return $session->data;
    }
668747
protected function getFileName($id)
    {
        $directory = $this->getDirectory($id);
        $hash      = sha1($id, false);
        $file      = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';
        return $file;
    }
120853
public function getDeclaringMethodId($method_id)
    {
        $method_id = strtolower($method_id);

        list($fq_class_name, $method_name) = explode('::', $method_id);

        $fq_class_name = $this->classlikes->getUnAliasedName($fq_class_name);

        $class_storage = $this->classlike_storage_provider->get($fq_class_name);

        if (isset($class_storage->declaring_method_ids[$method_name])) {
            return $class_storage->declaring_method_ids[$method_name];
        }

        if ($class_storage->abstract && isset($class_storage->overridden_method_ids[$method_name])) {
            return $class_storage->overridden_method_ids[$method_name][0];
        }
    }
45276
public function denyElement($file_id)
    {
        /** @var LazaretManipulator $lazaretManipulator */
        $lazaretManipulator = $this->app['manipulator.lazaret'];

        $ret = $lazaretManipulator->deny($file_id);

        return $this->app->json($ret);
    }
1339034
public function delete($file_id)
    {
        if (empty($file_id)) {
            return false;
        }

        $deleted = $count = 0;
        foreach ((array) $this->file->getList(array('file_id' => $file_id)) as $file) {
            $deleted += (int) $this->file->delete($file['file_id']);
            $count++;
        }

        return $count && $count == $deleted;
    }
419025
public function readFileHandle($file_handle)
    {
        if (!is_resource($file_handle))
            throw new \InvalidArgumentException("No file handle was provided");

        $data = array();
        $this->file_handle = $file_handle;

        foreach ($this as $row)
            $data[] = $row;

        return $data;
    }
178744
public static function pathModeInfo(string $file_path): int
    {
        /* 如果不存在，则不可读、不可写、不可改 */
        if (!file_exists($file_path)) {
            return false;
        }

        $mark = 0;

        if (0 === stripos(PHP_OS, 'WIN')) {
            /* 测试文件 */
            $test_file = $file_path . '/cf_test.txt';

            /* 如果是目录 */
            if (is_dir($file_path)) {
                /* 检查目录是否可读 */
                $dir = @opendir($file_path);

                //如果目录打开失败，直接返回目录不可修改、不可写、不可读
                if ($dir === false) {
                    return $mark;
                }

                //目录可读 001，目录不可读 000
                if (@readdir($dir) !== false) {
                    $mark ^= 1;
                }

                @closedir($dir);

                /* 检查目录是否可写 */
                $fp = @fopen($test_file, 'wb');

                //如果目录中的文件创建失败，返回不可写。
                if ($fp === false) {
                    return $mark;
                }

                //目录可写可读 011，目录可写不可读 010
                if (@fwrite($fp, 'directory access testing.') !== false) {
                    $mark ^= 2;
                }

                @fclose($fp);
                @unlink($test_file);

                /* 检查目录是否可修改 */
                $fp = @fopen($test_file, 'ab+');
                if ($fp === false) {
                    return $mark;
                }

                if (@fwrite($fp, "modify test.\r\n") !== false) {
                    $mark ^= 4;
                }

                @fclose($fp);

                /* 检查目录下是否有执行rename()函数的权限 */
                if (@rename($test_file, $test_file) !== false) {
                    $mark ^= 8;
                }

                @unlink($test_file);

                /* 如果是文件 */
            } elseif (is_file($file_path)) {
                /* 以读方式打开 */
                $fp = @fopen($file_path, 'rb');
                if ($fp) {
                    $mark ^= 1; //可读 001
                }

                @fclose($fp);

                /* 试着修改文件 */
                $fp = @fopen($file_path, 'ab+');
                if ($fp && @fwrite($fp, '') !== false) {
                    $mark ^= 6; //可修改可写可读 111，不可修改可写可读011...
                }

                @fclose($fp);

                /* 检查目录下是否有执行rename()函数的权限 */
                if (@rename($test_file, $test_file) !== false) {
                    $mark ^= 8;
                }
            }
        } else {
            if (@is_readable($file_path)) {
                $mark ^= 1;
            }

            if (@is_writable($file_path)) {
                $mark ^= 14;
            }
        }

        return $mark;
    }
1125235
public function delete($file_id){
        $filename=$this->config['base_path'].DIRECTORY_SEPARATOR.$file_id;
        unlink(ROOT_PATH.$filename);
        $p=explode(DIRECTORY_SEPARATOR,$file_id);
        $name=array_pop($p);
        $name_ext=explode(".",$name);
        $save_name=ROOT_PATH.$this->config['base_path'].DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR,$p).DIRECTORY_SEPARATOR
            .$name_ext[0].DIRECTORY_SEPARATOR;
        $files = (array) glob($save_name . '*');
        var_dump($save_name);
        foreach ($files as $path) {
            if (is_dir($path)) {
                array_map('unlink', glob($path . '/*.php'));
            } else {
                unlink($path);
            }
        }
        rmdir($save_name);
    }
834970
public function readFileHandle($file_handle)
    {
        if (!is_resource($file_handle))
            throw new \InvalidArgumentException("No file handle was provided");

        $contents = "";
        while (!feof($file_handle))
            $contents .= fread($file_handle, 8192);

        return $this->readString($contents);
    }
1301886
public function getFile($fileId)
    {
        $this->connect();

        $fileId = trim(trim($fileId, '/'));
        if ($fileId != '')
        {
            if (strpos($fileId, '/') === false)
            {
                $folder = $this->getFolder();
            }
            else
            {
                $pathinfo = pathinfo($fileId);
                $folder   = $this->getFolder($pathinfo['dirname']);
            }
            if ($folder)
            {
                return $folder->getFile($fileId);
            }
        }

        return false;
    }
769233
public function addFileToSet($f_id)
    {
        $app = Application::getFacadeApplication();
        if (is_object($f_id)) {
            $f = $f_id;
            if ($f instanceof FileEntity) {
                $file = $f;
                $fileVersion = $file->getApprovedVersion();
            } else {
                $fileVersion = $f;
                $file = $fileVersion->getFile();
            }
            $f_id = (int) $file->getFileID();
        } else {
            $f_id = (int) $f_id;
            $em = $app->make(EntityManagerInterface::class);
            $file = $em->find(FileEntity::class, $f_id);
            $fileVersion = $file->getApprovedVersion();
        }
        if ($file === null) {
            $result = null;
        } else {
            $file_set_file = File::createAndGetFile($f_id, $this->fsID);
            $fe = new \Concrete\Core\File\Event\FileSetFile($file_set_file);
            $director = $app->make(EventDispatcherInterface::class);
            $director->dispatch('on_file_added_to_set', $fe);
            if ($fileVersion !== null && $this->shouldRefreshFileThumbnails('add')) {
                $fileVersion->refreshThumbnails(false);
            }
            $result = $file_set_file;
        }

        return $result;
    }
567130
public function getRaw($fileId = null)
    {
        // does nothing with the text
        $lamdaFunction = function($text){ 
            return [$text];
        };        
        return $this->getWords($fileId, new LambdaTokenizer($lamdaFunction));        
    }
1368318
public function canDelete($file_id)
    {
        $sql = 'SELECT NOT EXISTS (SELECT file_id FROM product_sku WHERE file_id=:id)';
        return (bool) $this->db->fetchColumn($sql, array('id' => (int) $file_id));
    }
229889
public function read(/*# string */ $session_id)/*# : string */
    {
        $file = $this->getSessionFile($session_id);
        $content = @file_get_contents($file);
        if (false === $content) {
            $content = 'a:0:{}';
        }
        return $content;
    }
143052
protected function getOriginalFilename($fileID)
    {
        $parsedFiledID = $this->getPublicResolutionStrategy()->parseFileID($fileID);
        return $parsedFiledID ? $parsedFiledID->getFilename() : null;
    }