Package com.alibaba.otter.node.etl.common.io.download.exception

Examples of com.alibaba.otter.node.etl.common.io.download.exception.DataRetrieveException


            return getAria2cRetriever(type.getExe(), url, targetDir);
        } else {
            // 其他的类型
        }

        throw new DataRetrieveException("no DataRetriever for[" + type + "]");
    }
View Full Code Here


        Exec.Result result = null;
        try {
            result = Exec.execute(cmd);
            if (false == this.isSuccess(result.getExitCode())) {
                aborted.set(true);
                notifyException(new DataRetrieveException(result.toString()));
                notifyStatusChange(DownloadStatus.EXCEPTION);
            } else {
                this.analyzeResult(result);
                this.notifyMessage(result.toString());

                if (aborted.get()) {
                    // 中断
                    notifyStatusChange(DownloadStatus.ABORT);
                } else if (paused.get()) {
                    // 暂停
                    notifyStatusChange(DownloadStatus.PAUSED);
                } else {
                    // 下载完成
                    notifyStatusChange(DownloadStatus.COMPLETE);
                }
            }
        } catch (Exception ex) {
            aborted.set(true);
            notifyException(new DataRetrieveException((result != null) ? ex.getMessage() + SystemUtils.LINE_SEPARATOR
                                                                         + result.toString() : ex.getMessage(), ex));
        }

    }
View Full Code Here

    public byte[] getAssociatedMemoryData() {
        if (this.targetFile.exists()) {
            try {
                return NioUtils.read(this.targetFile);
            } catch (IOException e) {
                throw new DataRetrieveException(e);
            }
        } else {
            return new byte[] { (byte) 0 };
        }
    }
View Full Code Here

        }

        if (download.isCompleted()) {
            //
        } else if (download.isPaused()) {
            throw new DataRetrieveException("retry 3 times still have err, paused.");
        } else if (download.isAborted()) {
            throw new DataRetrieveException("aborted for some configration error.");
        }
    }
View Full Code Here

    public byte[] getDataAsByteArray() {
        try {
            return NioUtils.read(this.getDataAsFile());
        } catch (IOException e) {
            throw new DataRetrieveException(e);
        }
    }
View Full Code Here

    public byte[] getDataAsByteArray() {
        try {
            return NioUtils.read(mFile);
        } catch (IOException e) {
            throw new DataRetrieveException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.common.io.download.exception.DataRetrieveException

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.