Menu

#5 URI relativization not aware of absolute URI's

open
honensp
5
2014-08-14
2007-06-18
No

the relativizeURI method of the class PackagingURIHelper are not aware of absolute URI's so I cant do any absolute references in the package, i think that the method should act like the relativize method from the URI class of the Java API, that does

"1- If either this URI or the given URI are opaque, or if the scheme and authority components of the two URIs are not identical, or if the path of this URI is not a prefix of the path of the given URI, then the given URI is returned.
2- Otherwise a new relative hierarchical URI is constructed with query and fragment components taken from the given URI and with a path component computed by removing this URI's path from the beginning of the given URI's path."

this method is called inside the marshallRelationshipPart of the ZipPartMarshaller class, what does my relationships always been saved without the first "/" because it returns

return new URI(retPartName.getURI().getPath().substring(1));

Discussion

  • Julien CHABLE

    Julien CHABLE - 2007-06-18
    • assigned_to: nobody --> kimalawii
     
  • Julien CHABLE

    Julien CHABLE - 2007-06-20
    • assigned_to: kimalawii --> nobody
     
  • Julien CHABLE

    Julien CHABLE - 2007-07-02
    • assigned_to: nobody --> honensp
     
  • Guilherme Moro

    Guilherme Moro - 2007-07-26

    Test program to show the bug in action

     
  • Guilherme Moro

    Guilherme Moro - 2007-07-26

    Logged In: YES
    user_id=1806282
    Originator: YES

    I have a little program that try to create the customXML part and set his relationships, and can show where the bug occurs, I'm attaching it in this comment.

    if you open up the generated document, you will see that the document.xml.rels archive shows up

    <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml" Target="customXMLguilherme/mytest.xml"/>
    </Relationships>

    but the target ** Target="customXMLguilherme/mytest.xml" ** need to be ** Target="/customXMLguilherme/mytest.xml" ** because i'm using absolute references to the part.

    Any doubt, or if the code looks a little messy ,just ask me.. I'll be very happy to help..

    File Added: Tests.rar

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.