Package org.apache.jackrabbit.webdav.util

Examples of org.apache.jackrabbit.webdav.util.LinkHeaderFieldParser


* <code>LinkHeaderFieldParserTest</code>...
*/
public class LinkHeaderFieldParserTest extends TestCase {

    public void testSimple() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections.singletonList("<a>; rel=foo"));
        assertEquals("a", lhfp.getFirstTargetForRelation("foo"));
    }
View Full Code Here


                Collections.singletonList("<a>; rel=foo"));
        assertEquals("a", lhfp.getFirstTargetForRelation("foo"));
    }

    public void testMulti() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections.singletonList("<a>; rel=foo, <b>; rel=bar"));
        assertEquals("b", lhfp.getFirstTargetForRelation("bar"));
    }
View Full Code Here

                Collections.singletonList("<a>; rel=foo, <b>; rel=bar"));
        assertEquals("b", lhfp.getFirstTargetForRelation("bar"));
    }

    public void testMultiQs() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections
                        .singletonList("<a,>; rel=\"fo\\\"o,\", <b,>; rel=bar"));
        assertEquals("b,", lhfp.getFirstTargetForRelation("bar"));
    }
View Full Code Here

                        .singletonList("<a,>; rel=\"fo\\\"o,\", <b,>; rel=bar"));
        assertEquals("b,", lhfp.getFirstTargetForRelation("bar"));
    }

    public void testTruncated() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections.singletonList("<a,>; rel=\"x\\\""));
        assertEquals("a,", lhfp.getFirstTargetForRelation("x\\"));
    }
View Full Code Here

                Collections.singletonList("<a,>; rel=\"x\\\""));
        assertEquals("a,", lhfp.getFirstTargetForRelation("x\\"));
    }

    public void testCommas() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections.singletonList(",<a>; rel=\"xy,z\","));
        assertEquals("a", lhfp.getFirstTargetForRelation("xy,z"));
    }
View Full Code Here

                Collections.singletonList(",<a>; rel=\"xy,z\","));
        assertEquals("a", lhfp.getFirstTargetForRelation("xy,z"));
    }

    public void testMultiRel() {
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                Collections.singletonList(",<a>; rel=\"a b\""));
        assertEquals("a", lhfp.getFirstTargetForRelation("a"));
    }
View Full Code Here

                Session session = sessionProvider.getSession(
                        request, repository, workspaceName);

                // extract information from Link header fields
                LinkHeaderFieldParser lhfp =
                        new LinkHeaderFieldParser(request.getHeaders("Link"));
                setJcrUserData(session, lhfp);
                setSessionIdentifier(session, lhfp);

                return session;
            } catch (LoginException e) {
View Full Code Here

        } else {
            s = repository.login(creds, workspace);
        }

        // extract information from Link header fields
        LinkHeaderFieldParser lhfp = new LinkHeaderFieldParser(
                request.getHeaders("Link"));
        String userData = getJcrUserData(lhfp);
        s.getWorkspace().getObservationManager().setUserData(userData);

        String sessionId = getSessionIdentifier(lhfp);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.util.LinkHeaderFieldParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.