W3C home > Mailing lists > Public > www-jigsaw@w3.org > November to December 1996

Found problem for CgiPassDirectory

From: bpm <bpm@terraweb.com>
Date: Fri, 22 Nov 1996 12:00:05 -0600
To: www-jigsaw@w3.org
Message-ID: <19961122180005.AAA8535@vlad.terraweb.com>
Well, for what its worth,
	I found my brain fart that caused the CgiPassDirectory to not
work. In the code I send to you Anselm, I had this defined in the
CgiDirectory.java file:

 	protected HTTPResource cloneDirectory(String name) {
		HTTPResource template = getTemplate();
		if ( template == null ) {
			// Sever config error, track ity:
			getServer().errlog(getClass().getName()+
							   "@"+
							   getURL()+
							   ": no template !");
			return null;
		}
		File file = new File(getDirectory(), name) ;
		Hashtable defs = new Hashtable(13);
		defs.put("parent", this);
		defs.put("directory", file) ;
		defs.put("identifier", name);
		defs.put("resource-store", children) ;
		defs.put("server", getServer()) ;
		defs.put("url", getURL() + name);
		try {
			return (CgiDirectory) getClone(defs);
		} catch (Exception ex) {
			ex.printStackTrace() ;
			return null ;
		}
	}

It needed a templet.getClone!  So here is the correct form:

 	protected HTTPResource cloneDirectory(String name) {
		HTTPResource template = getTemplate();
		if ( template == null ) {
			// Sever config error, track ity:
			getServer().errlog(getClass().getName()+
							   "@"+
							   getURL()+
							   ": no template !");
			return null;
		}
		File file = new File(getDirectory(), name) ;
		Hashtable defs = new Hashtable(13);
		defs.put("parent", this);
		defs.put("directory", file) ;
		defs.put("identifier", name);
		defs.put("resource-store", children) ;
		defs.put("server", getServer()) ;
		defs.put("url", getURL() + name);
		try {
			return (CgiDirectory) template.getClone(defs);
        // ignore this comment    ^^^^^^^^^
		} catch (Exception ex) {
			ex.printStackTrace() ;
			return null ;
		}
	}
	
It gives me the correct functionality, but the directories under the
directory that the CgiPassDirectory points to are of reference
"CgiDirectory" not "CgiPassDirectory".  Which makes me wonder if this
is not correct behavior.  The subdirectories ARE CgiDirectories, not
CgiPassDirectories.  It is just their parent that is a
CgiPassDirectory.  So I guess it is correct after all!

Thanks

-- 
---
Brian Millett                    
Technology Applications Inc.     "Heaven can not exist,
(314) 530-1981                          If the family is not eternal"
bpm@techapp.com                   F. Ballard Washburn
Received on Friday, 22 November 1996 12:57:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT