• 大小: 7.48MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-12
  • 语言: 其他
  • 标签: 翻译  

资源简介

一种小型的翻译集合工具,支持的翻译来源谷歌、百度、腾讯、金山、有道、欧米翻译

资源截图

代码片段和文件信息

package com.lsj.http;

import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public abstract class AbstractHttpParams implements HttpParams{
protected final Map params = new HashMap<>();

@Override
public HttpParams put(String key String value){
params.put(key value);
return this;
}

@Override
public String send2String(String baseUrl) throws Exception {
CloseableHttpClient httpClient = HttpClients.createDefault();
try{
CloseableHttpResponse response = send(httpClient baseUrl);
return EntityUtils.toString(response.getEntity());
}finally{
httpClient.close();
}
}

@Override
public InputStream send2InputStream(String baseUrl) throws Exception {
CloseableHttpClient httpClient = HttpClients.createDefault();
try{
CloseableHttpResponse response = send(httpClient baseUrl);
return response.getEntity().getContent();
}finally{
httpClient.close();
}
}

abstract protected CloseableHttpResponse send(CloseableHttpClient httpClient String baseUrl) throws Exception ;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......      1388  2017-03-31 15:44  translate-set-master\.classpath

    .......       371  2017-03-31 15:44  translate-set-master\.project

    .......        70  2017-03-31 15:44  translate-set-master\.settings\org.eclipse.core.resources.prefs

    .......       587  2017-03-31 15:44  translate-set-master\.settings\org.eclipse.jdt.core.prefs

    .......        13  2017-03-31 15:44  translate-set-master\bin\.gitignore

    .......      2212  2017-03-31 15:44  translate-set-master\bin\com\lsj\http\AbstractHttpParams.class

    .......      1776  2017-03-31 15:44  translate-set-master\bin\com\lsj\http\HttpGetParams.class

    .......      3026  2017-03-31 15:44  translate-set-master\bin\com\lsj\http\HttpMimeParams.class

    .......       386  2017-03-31 15:44  translate-set-master\bin\com\lsj\http\HttpParams.class

    .......      2719  2017-03-31 15:44  translate-set-master\bin\com\lsj\http\HttpPostParams.class

    .......      1168  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\AbstractOnlineTranslator.class

    .......       450  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\annotation\TranslatorComponent.class

    .......       489  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\exception\DupIdException.class

    .......      4908  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\factory\AbstractTranslatorFactory.class

    .......       182  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\factory\TFactory.class

    .......       882  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\factory\TranslatorFactory.class

    .......      2538  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\impl\BaiduTranslator.class

    .......      4485  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\impl\GoogleTranslator.class

    .......      1872  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\impl\JinshanTranslator.class

    .......      2312  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\impl\TencentTranslator.class

    .......      2988  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\impl\YoudaoTranslator.class

    .......       991  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\LANG.class

    .......       260  2017-03-31 15:44  translate-set-master\bin\com\lsj\Trans\Translator.class

    .......      2490  2017-03-31 15:44  translate-set-master\bin\test\TransTest.class

    .......    231320  2017-03-31 15:44  translate-set-master\jar\commons-beanutils-1.8.0.jar

    .......    263965  2017-03-31 15:44  translate-set-master\jar\commons-codec-1.9.jar

    .......    575389  2017-03-31 15:44  translate-set-master\jar\commons-collections-3.2.1.jar

    .......    279193  2017-03-31 15:44  translate-set-master\jar\commons-lang-2.5.jar

    .......     60841  2017-03-31 15:44  translate-set-master\jar\commons-logging-1.1.1.jar

    .......     61829  2017-03-31 15:44  translate-set-master\jar\commons-logging-1.2.jar

............此处省略76个文件信息

评论

共有 条评论