public function getAssets(PortableElementObject $object, $type=null)
    {
        $assets = [];
        if (is_null($type) || ($type == 'runtime')) {
            $assets = ['runtime' => $object->getRuntimePath()];
        }

        if (is_null($type) || ($type == 'creator')) {
            if (! empty($object->getCreator())) {
                $assets['creator'] = $object->getCreatorPath();
            }
        }

        $files = [];
        foreach ($assets as $key => $asset) {
            $constraints = $this->getAssetConstraints($key);
            foreach ($constraints as $constraint) {
                if (! isset($asset[$constraint])) {
                    if ($this->isOptionalConstraint($key, $constraint)) {
                        continue;
                    }
                    throw new PortableElementInvalidAssetException('Missing asset file for ' . $key . ':' . $constraint);
                }
                if (is_array($asset[$constraint])) {
                    //get a flat list out of the structure of file data
                    $it = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($asset[$constraint]));
                    foreach($it as $k => $v) {
                        if(!in_array(strval($k), $object->getRegistrationExcludedKey()) && !empty($v)){
                            $files[] = $v;
                        }
                    }
                } else {
                    if(!empty($asset[$constraint])){
                        $files[] = $asset[$constraint];
                    }
                }
            }
        }
        return $files;
    }