Examples of UURI


Examples of org.archive.net.UURI

    }


    protected CrawlURI makeCrawlURI(String uri) throws URIException,
            IOException {
        UURI uuri = UURIFactory.getInstance(uri);
        CrawlURI curi = new CrawlURI(uuri);
        curi.setSeed(true);
        curi.setRecorder(getRecorder());
        return curi;
    }
View Full Code Here

Examples of org.archive.net.UURI

    public void testSerialization() throws Exception {
        TestUtils.testSerialization(new CrawlServer("hi"));
    }

    public void testGetServerKey() throws Exception {
        UURI u1 = UURIFactory.getInstance("https://www.example.com");
        assertEquals(
                "bad https key",
                "www.example.com:443",
                CrawlServer.getServerKey(u1));
    }
View Full Code Here

Examples of org.archive.net.UURI

        assertFalse(dr.evaluate(testUri));
    }
   
   
    private CrawlURI createTestUri(String urlStr) throws URIException {
        UURI testUuri = UURIFactory.getInstance(urlStr);
        CrawlURI testUri = new CrawlURI(testUuri, null, null, LinkContext.NAVLINK_MISC);

        return testUri;
    }
View Full Code Here

Examples of org.archive.net.UURI

    throws InterruptedException {       
    }


    public static String flattenVia(CrawlURI puri) {
        UURI uuri = puri.getVia();
        return (uuri == null) ? "" : uuri.toString();
    }
View Full Code Here

Examples of org.archive.net.UURI

        boolean result = false;
        String curiStr = curi.getUURI().toString();
        String loginUri = getPrerequisite(curi);
        if (loginUri != null) {
            try {
                UURI uuri = UURIFactory.getInstance(curi.getUURI(), loginUri);
                if (uuri != null && curiStr != null &&
                    uuri.toString().equals(curiStr)) {
                    result = true;
                    if (!curi.isPrerequisite()) {
                        curi.setPrerequisite(true);
                        logger.fine(curi + " is prereq.");
                    }
View Full Code Here

Examples of org.archive.net.UURI

            return true;
        }

        for (String uri: uris) {
            try {
                UURI src = curi.getUURI();
                UURI dest = UURIFactory.getInstance(uri);
                LinkContext lc = LinkContext.NAVLINK_MISC;
                Hop hop = Hop.NAVLINK;
                addOutlink(curi, dest, lc, hop);
            } catch (URIException e1) {
                // There may not be a controller (e.g. If we're being run
View Full Code Here

Examples of org.archive.net.UURI

   
    @Override
    protected Collection<TestData> makeData(String content, String destURI)
    throws Exception {
        List<TestData> result = new ArrayList<TestData>();
        UURI src = UURIFactory.getInstance("http://www.archive.org/start/");
        CrawlURI euri = new CrawlURI(src, null, null,
            LinkContext.SPECULATIVE_MISC);
        Recorder recorder = createRecorder(content, "UTF-8");
        euri.setContentType("text/xml");
        euri.setRecorder(recorder);
        euri.setContentSize(content.length());
               
        UURI dest = UURIFactory.getInstance(destURI);
        CrawlURI link = euri.createCrawlURI(dest, LinkContext.SPECULATIVE_MISC, Hop.SPECULATIVE);
        result.add(new TestData(euri, link));
       
        return result;
    }
View Full Code Here

Examples of org.archive.net.UURI

     * @param hop
     */
    protected void addOutlink(CrawlURI curi, String uri, LinkContext context,
            Hop hop) {
        try {
            UURI dest = UURIFactory.getInstance(curi.getUURI(), uri);
            CrawlURI link = curi.createCrawlURI(dest, context, hop);
            curi.getOutLinks().add(link);
        } catch (URIException e) {
            logUriError(e, curi.getUURI(), uri);
        }
View Full Code Here

Examples of org.archive.net.UURI

        return ret.toString();
    }
   
    public static CrawlURI addRelativeToBase(CrawlURI uri, int max,
            String newUri, LinkContext context, Hop hop) throws URIException {
        UURI dest = UURIFactory.getInstance(uri.getBaseURI(), newUri);
        return add2(uri, max, dest, context, hop);
    }
View Full Code Here

Examples of org.archive.net.UURI

    }

   
    public static CrawlURI addRelativeToVia(CrawlURI uri, int max, String newUri,
            LinkContext context, Hop hop) throws URIException {
        UURI relTo = uri.getVia();
        if (relTo == null) {
            if (!uri.getAnnotations().contains("usedBaseForVia")) {
                LOGGER.info("no via where expected; using base instead: " + uri);
                uri.getAnnotations().add("usedBaseForVia");
            }
            relTo = uri.getBaseURI();
        }
        UURI dest = UURIFactory.getInstance(relTo, newUri);
        return add2(uri, max, dest, context, hop);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.