class URLConnection extends java.net.URLConnection {

    @Override
    public String getHeaderField(int index) {
		assert index >= 0 : AssertMessages.positiveOrZeroParameter();
		try {
			connect();
		} catch (IOException e) {
			throw new IllegalStateException(e);
		}
    	switch (index) {
    	case 0:
    		// content-type
    		return this.contentType;
    	case 1:
    		// content-length
    		return Long.toString(this.file.length());
    	case 2:
    		// last-modified
    		return Long.toString(this.file.lastModified());
    	default:
    	}
    	return null;
    }

    protected  URLConnection(URL url);

}