public void generateDirectoryListing( UUID sid,
					  OutputStream out )
	throws IOException {

	
	FileHandler phpHandler = this.getHTTPHandler().getFileHandlerByExtension( ".php" );
	
	try {
	    // Create some dummy values

	    HTTPHeaders dummyHeaders = new HTTPHeaders();
	    //URI dummyURI             = new URI();
	    String newPath           = "/system/directory.listing.php";
	    String newQuery          = "requestURI=" + this.getRequestURI().getPath();
	    newQuery += "&absoluteDirectoryPath=" + this.getDirectoryFile().getAbsolutePath();
	    URI dummyURI = new URI( this.getRequestURI().getScheme(), 
				    this.getRequestURI().getAuthority(), // String authority, 
				    newPath, // this.getRequestURI().getPath(),      // String path, 
				    newQuery,   // String query, 
				    this.getRequestURI().getFragment()  
				    );
	    File directory = new File( this.getHTTPHandler().getDocumentRoot(), "system/directory.listing.php" );
	    System.out.println( dummyURI );
	    
	    Resource resource = phpHandler.process( sid,
						    dummyHeaders, // headers,
						    null, // postData,
						    directory, // this.getDirectoryFile(), //file,
						    dummyURI     //requestURI 
						    );
	    resource.open( true ); // Open in read-only mode
	    InputStream in = resource.getInputStream();

	    //int b;
	    //while( (b = in.read()) != -1 )
	    //System.out.println( (char)b );

	    long transferredBytes = CustomUtil.transfer( in, 
							 out, 
							 -1, // Long.MAX_VALUE,
							 256 // buffer size
							 );

	    resource.close();	    
	    
	    //System.out.println( "gak" );
	    //out.write( new String("This is a test.").getBytes() );
	    //out.flush();

	} catch( URISyntaxException e ) {

	    // This should not happen.
	    this.getLogger().log( Level.WARNING,
				  getClass().getName() + ".generateDirectoryListing(...)",
				  "[URISyntaxException] " + e.getMessage() 
				  );
	    throw new IOException( "Failed to generate PHP-based directory listing: " + e.getMessage() );
	} catch( HeaderFormatException e ) {

	    // This should not happen.
	    this.getLogger().log( Level.WARNING,
				  getClass().getName() + ".generateDirectoryListing(...)",
				  "[HeaderFormatException] " + e.getMessage() 
				  );
	    throw new IOException( "Failed to generate PHP-based directory listing: " + e.getMessage() );

	} catch( DataFormatException e ) {

	    // This should not happen.
	    this.getLogger().log( Level.WARNING,
				  getClass().getName() + ".generateDirectoryListing(...)",
				  "[DataormatException] " + e.getMessage() 
				  );
	    throw new IOException( "Failed to generate PHP-based directory listing: " + e.getMessage() );

	} catch( UnsupportedFormatException e ) {

	    // This should not happen.
	    this.getLogger().log( Level.WARNING,
				  getClass().getName() + ".generateDirectoryListing(...)",
				  "[UnsupportedFormatException] " + e.getMessage() 
				  );
	    throw new IOException( "Failed to generate PHP-based directory listing: " + e.getMessage() );
	    
	    }
    }