All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.fartherp.framework.compress.shell.CompressShell Maven / Gradle / Ivy

There is a newer version: 3.0.6
Show newest version
/*
 * Copyright (c) 2017. CK. All rights reserved.
 */

package com.github.fartherp.framework.compress.shell;

import com.github.fartherp.framework.common.util.Tools;

import java.io.File;

/**
 * Created by IntelliJ IDEA.
 * Author: CK
 * Date: 2015/4/15
 */
public abstract class CompressShell {
    protected void compress(String command) {
        try {
            Tools.executeShell(command);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    protected void unCompress(String command) {
        try {
            Tools.executeShell(command);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    protected void validation(String source) {
        File file = new File(source);
        if (!file.exists()) {
            throw new RuntimeException("压缩文件不存在 :" + file.getName());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy