public function deploy( $type = null, $debug = true, $filepermission = 0644, $dirpermission = 0755 )
	{
		foreach( $this->_registeredPackages as $filetype => $packageFiles )
		{
			if( $type !== null && $filetype !== $type ) {
				continue;
			}

			foreach( $packageFiles as $package)
			{
				$packageFile = $this->_basePath . $this->_deployDir . $package->file;

				$packageDir = dirname( $packageFile );

				if( DIRECTORY_SEPARATOR !== '/' ) {
					$packageDir = str_replace( '/', DIRECTORY_SEPARATOR, $packageDir );
				}

				if( !is_dir( $packageDir ) )
				{
					if( mkdir( $packageDir, $dirpermission, true ) === false ) {
						throw new MW_Jsb2_Exception( sprintf( 'Unable to create path for package file "%1$s"', $packageDir ) );
					}
				}

				$this->_minify( $package, $debug, $filepermission );
			}
		}
	}