Package com.alibaba.otter.node.etl.common.io.download.impl.aria2c

Examples of com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever


    private static final String tmp = System.getProperty("java.io.tmpdir", "/tmp");

    @Test
    public void testDownLoad_ok() {
        DataRetriever retriever = new Aria2cRetriever("http://china.alibaba.com", tmp);
        try {
            retriever.connect();
            retriever.doRetrieve();
        } catch (DataRetrieveException ex) {
            retriever.abort();
        } finally {
            retriever.disconnect();
        }
    }
View Full Code Here


        }
    }

    @Test
    public void testDownLoad_failed() {
        DataRetriever retriever = new Aria2cRetriever("aaaaaaa/sssss", tmp);
        try {
            retriever.connect();
            retriever.doRetrieve();
        } catch (DataRetrieveException ex) {
            retriever.abort();
        } finally {
            retriever.disconnect();
        }
    }
View Full Code Here

    private DataRetriever getAria2cRetriever(String cmd, String url, String targetDir) {
        if (StringUtils.isEmpty(cmd)) {
            cmd = (SystemUtils.IS_OS_WINDOWS ? cmd + ".exe" : cmd);
        }
        return new Aria2cRetriever(cmd, url, targetDir);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever

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.