package com.artfess.ueditor.hunter;

import com.artfess.ueditor.define.BaseState;
import com.artfess.ueditor.define.MultiState;
import com.artfess.ueditor.define.State;

import java.util.Map;

public class FileManager {
    private int count;
    private int total;

    public static String endpoint;
    public static String accessKeyId;
    public static String accessKeySecret;
    public static String baseUrl;
    public static String bucket;
    public static String uploadDirPrefix;
    public static int pageSize;

    public FileManager(Map<String, Object> conf) {
        this.count = (Integer) conf.get("count");

    }

    public State listFile(int index, String marker) {
        return null;
    }

    public State deleteFile(String key) {
        return null;
    }

    private State getState(String[] files) {
        MultiState state = new MultiState(true);
        BaseState fileState;

        for (String url : files) {
            if (url == null) break;
            fileState = new BaseState(true);
            fileState.putInfo("url", baseUrl + "/" + url);
            state.addState(fileState);
        }

        return state;
    }
}
