com.github.yoojia.halo.Downloads Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of halo-download Show documentation
Show all versions of halo-download Show documentation
A FAST && THIN && HIGH SCALABLE Java web framework
package com.github.yoojia.halo;
/**
* @author YOOJIA.CHEN ([email protected])
*/
public class Downloads {
private static final String PATH_KEY = "[email protected]#" + Math.random();
private static final String NAME_KEY = "[email protected]#" + Math.random();
private final HaloRequest request;
private Downloads(HaloRequest request) {
this.request = request;
}
public static Downloads use(HaloRequest request){
return new Downloads(request);
}
public Downloads setResourcePath(String filePath) {
request.coreParams.put(PATH_KEY, filePath);
return this;
}
public Downloads setResourceName(String name){
request.coreParams.put(NAME_KEY, name);
return this;
}
static String getResourcePath(HaloRequest request){
return request.coreParams.containsKey(PATH_KEY) ?
(String) request.coreParams.get(PATH_KEY) :
null;
}
static String getResourceName(HaloRequest request){
return request.coreParams.containsKey(NAME_KEY) ?
(String) request.coreParams.get(NAME_KEY) :
null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy