redis数据集插件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
786 B

package com.fr.plugin.db.redis.help;
import com.eclipsesource.v8.V8;
import com.fr.general.IOUtils;
import com.fr.io.utils.ResourceIOUtils;
import com.fr.stable.EncodeConstants;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-19
*/
public class Files {
private V8 v8;
public Files(V8 v8) {
this.v8 = v8;
}
@ScriptBridge
public void require(String filePath) {
InputStream in = ResourceIOUtils.read(filePath);
if (in != null) {
try {
v8.executeVoidScript(IOUtils.inputStream2String(in, EncodeConstants.ENCODING_UTF_8));
} catch (UnsupportedEncodingException ignore) {
}
}
}
}