Does this question have anything to do with Xerces?

I would expect a query string in a jar: URI to cause problems. To form a URI out of a base URI and a relative URI, the query string and/or fragment identifier should be stripped, the URI truncated at the final / and the relative URI processed (in this case, appended). AFAICT, you should have wound up with a URI of:

jar:embeddedzipfile:file:/home/cprowse/repository.dtd

The result you claim is surprising, but your example is suspicious. How did 'repository.dtd' become 'repository.xml'? Why did you cast base to URI?

Bob Foster

Cory Prowse wrote:
I have an application that loads resources from an embedded zip file. This is done via a protocol handler, so the following URI is obtained:

jar:embeddedzipfile:file:/home/cprowse/data.zip?lib/config.jar!/repository.xml


Which follows the normal JAR symantecs of: jar:<url>!/{entry}

However URI is not handling this and parses it as follows:
Scheme: jar
SchemeSpecificPart: embeddedzipfile:file:/home/cprowse/data.zip?lib/config.jar!/repository.xml
Host: null
Path: embeddedzipfile:file:/home/cprowse/Development/conductor_instance/WEB-INF/modules/ComposerCAM-1.01.02.cam


  QueryString: lib/ComposerData-1.01.02.jar!/repository.xml

This breaks things when this is used as a baseURI.

For example, when the above URI is used in the URI constructor as follows:
  new URI((URI)base, "repository.dtd");

I get:
Scheme: jar
SchemeSpecificPart: embeddedzipfile:file:/home/cprowse/Development/conductor_instance/WEB-INF/modules/ComposerCAM-1.01.02.cam?lib/ComposerData-1.01.02.jar!/repository.xml


Host: null
Path: embeddedzipfile:file:/home/cprowse/Development/conductor_instance/WEB-INF/modules/ComposerCAM-1.01.02.cam


  QueryString: lib/ComposerData-1.01.02.jar!/repository.xml

I've started a small patch on URI to make it aware of the jar scheme.
Has this come up before for anyone?

 -- Cory

Important notice: This message is intended for the individual(s) and entity(s) addressed. The information contained in this transmission and any attached, may be confidential and may also be the subject of legal privilege, public interest immunity or legal professional privilege. Any review, retransmission, dissemination or other use of, taking of any action in reliance upon this information by person or entities other than the recipient is prohibited and requires authorization from the sender. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person) you may not copy or deliver this message to anyone. In such cases you should destroy this message and kindly notify the sender by reply email.

WARNING: Although Infocomp has taken reasonable precautions so that no viruses are present in this e-mail, the company cannot accept responsibility for any loss or damage arising from the use of e-mail attachments.




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to