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

cn.schoolwow.util.domain.query.resource.QueryResource Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package cn.schoolwow.util.domain.query.resource;

import cn.schoolwow.util.module.query.resource.domain.ResourceQueryOption;
import cn.schoolwow.util.module.query.resource.domain.SingleQueryResourceHandler;

public class QueryResource {
    private ResourceQueryOption resourceQueryOption = new ResourceQueryOption();

    /**
     * 创建资源查询对象
     * @param name 资源名称
     * @param path 资源路径
     * */
    public static QueryResource newQuery(String name, String path){
        QueryResource instanceQuery = new QueryResource();
        instanceQuery.resourceQueryOption.name = name;
        instanceQuery.resourceQueryOption.path = path;
        return instanceQuery;
    }

    public QueryResource checkExist(boolean checkExist){
        resourceQueryOption.checkExist = checkExist;
        return this;
    }

    public QueryResource fileNameStartWith(String fileNameStartWith){
        resourceQueryOption.fileFilterOption.fileNameStartWith = fileNameStartWith;
        return this;
    }

    public QueryResource fileNameEndWith(String fileNameEndWith){
        resourceQueryOption.fileFilterOption.fileNameEndWith = fileNameEndWith;
        return this;
    }

    public QueryResource singleQueryResourceHandler(SingleQueryResourceHandler singleQueryResourceHandler){
        resourceQueryOption.fileFilterOption.singleQueryResourceHandler = singleQueryResourceHandler;
        return this;
    }

    public QueryResourceResponse execute(){
        return new QueryResourceResponse(resourceQueryOption);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy