package com.mx.hbasefile.hadoop.hdfs.api;

import java.io.IOException;
import java.io.InputStream;

/**
 * @ClassName HdfsOperations
 * @Author zzrdark
 * @Date 2019-08-14 17:48
 * @Description TODO
 **/
public interface HdfsOperations {
    /**
     * 保存文件
     * @param dir
     * @param name
     * @param input
     * @param length
     * @param replication
     * @throws IOException
     */
    public void saveFile(String dir, String name,
                         InputStream input, long length, short replication) throws IOException;

    /**
     *  删除文件
     * @param dir
     * @param name
     * @throws IOException
     */
    public void deleteFile(String dir, String name) throws IOException;

    /**
     * 打开文件
     * @param dir
     * @param name
     * @return
     * @throws IOException
     */
    public InputStream openFile(String dir, String name) throws IOException;

    /**
     * 新建文件夹
     * @param dir
     * @throws IOException
     */
    public void mikDir(String dir) throws IOException;

    /**
     * 删除文件夹
     * @param dir
     * @throws IOException
     */
    public void deleteDir(String dir) throws IOException;

    void moveFile(String src, String dest) throws IOException;
}
