精华内容
下载资源
问答
  • blob为一个特殊字段 可以保存4G的数据 包括图片、视频等 /*** @功能信息 :导出Word文档* @参数信息 :outfile:文件路径,id:文档编号* @返回值信息 :* @异常信息 :*/public boolean readDoc(String outfile, Strin.....

    前几天因为项目需要 做了一个导出 是在Oracle中blob字段导出数据生成word 然后再下载到客户端

    blob为一个特殊字段 可以保存4G的数据 包括图片、视频等

    /**
    * @功能信息 :导出Word文档
    * @参数信息 :outfile:文件路径,id:文档编号
    * @返回值信息 :
    * @异常信息 :
    */
    public boolean readDoc(String outfile, String id) throws Exception {
       DbaObj = new DBstep.iDBManager2000(); // 创建数据库对象
       FileOutputStream fos = null;
       InputStream is = null;
       boolean mResult = false;

       String Sql = "SELECT FileBody,FileSize FROM info_document_file WHERE RecordID='"
         + id + "'";
       try {
        if (DbaObj.OpenConnection()) {
         try {
          ResultSet result = DbaObj.ExecuteQuery(Sql);
          if (result.next()) {
           try {
            int fileSize = result.getInt("FileSize");
            Blob blob = result.getBlob("FileBody");
            file = new File(outfile);

            if (!file.exists()) {
             file.createNewFile();// 如果文件不存在,则创建
            }

            fos = new FileOutputStream(file);
            is = blob.getBinaryStream();// 读出数据后转换为二进制流
            byte[] data = new byte[fileSize];
            int size = 0;

            while ((size = is.read(data)) != -1) {
             fos.write(data, 0, size);
            }

           } catch (Exception ex) {
            ex.printStackTrace();
           }
          }
          result.close();
          mResult = true;
         } catch (SQLException e) {
          e.printStackTrace();
          mResult = false;
         }
        }
       } finally {
        DbaObj.CloseConnection();
        fos.close();
        is.close();
       }
       return (mResult);
    }

    注:因为用到了第三方控件 所以这块未使用Hibernate 以后有时间 可以进行修改

    /**
    * 导出功能
    *
    * @param mapping
    * @param form
    * @param request
    * @param response
    * @return
    * @throws Exception
    */
    public ActionForward export(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
       List list = new ArrayList();
       // 生成随机文件名
       java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyymmddhhmmss");
       String result = format.format(new java.util.Date());

       ReportForm report = (ReportForm) form;
       String[] exportlist = report.getIds();

       //String str = "导出失败";
       String path = request.getRealPath("/") + "upload/";

       for (int i = 0; i < exportlist.length; i++) {
        if (readDoc(path + exportlist[i] + ".doc", exportlist[i])) {
         //str = "导出成功";
         list.add(exportlist[i] + ".doc");
         // download("http://localhost:8080/infoOA/upload/"+exportlist[i]+".doc",exportlist[i]+".doc");
        }
       }
       // 先生成zip为文件 再删除doc文件
       getZip(list, path, result);
      
       for (int i = 0; i < exportlist.length; i++) {
        deleteFile(new File(path+exportlist[i] + ".doc"));
       }
      
       downLoad(result, path, response);
       //删除zip文件
       deleteFile(new File(path+result+ ".zip"));
            //request.setAttribute("message", str);
       return null;
    }

     

    /**
    * 压缩文件zip
    * @功能信息 :
    * @参数信息 :
    * @返回值信息 :
    * @异常信息 :
    */
    public void getZip(List list,String path,String fileName) throws Exception{
        byte[] buffer = new byte[1024];
       
       String strZipName = fileName + ".zip";
       ZipOutputStream out = new ZipOutputStream(new FileOutputStream(path
                                         + strZipName));
       for (int j = 0; j < list.size(); j++) {
        String name = list.get(j).toString();
        FileInputStream fis = new FileInputStream(path + name);
        out.putNextEntry(new ZipEntry(name));
        int len;
        while ((len = fis.read(buffer)) > 0) {
         out.write(buffer, 0, len);
        }
        out.closeEntry();
        fis.close();
       }
       out.close();
       System.out.println("生成Demo.zip成功");  
       }

    /**
       * 文件下载
       *
       * @功能信息 :
       * @参数信息 :
       * @返回值信息 :
       * @异常信息 :
       */
    public void downLoad(String fileName,String path, HttpServletResponse response) throws IOException {
       String strZipName = fileName + ".zip";
       BufferedInputStream bis = null;
       BufferedOutputStream bos = null;
       OutputStream os = null;
       InputStream is = null;
       try {
        File file = new File(path + strZipName);
        if (!file.exists()) {
         System.out.println("文件不存在");
        }

        is = new FileInputStream(file);
        bis = new BufferedInputStream(is);
        os = response.getOutputStream();
        bos = new BufferedOutputStream(os);

        response.setHeader("Pragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
        response.setContentType("application/x-msdownload;charset=utf-8");
        response.setHeader("Content-disposition", "attachment;filename="
                   + URLEncoder.encode(strZipName, "utf-8"));
       
        int bytesRead = 0;
        byte[] buffer = new byte[8192];
        while ((bytesRead = bis.read(buffer, 0, 8192)) != -1) {
         bos.write(buffer, 0, bytesRead);
        }

        bos.flush();
        is.close();
        bis.close();
        os.close();
        bos.close();
       } catch (Exception e) {
        e.printStackTrace();
       }
       }

       /**
       * 删除文件信息 根据boolean类型判断文件是否存在
       *
       * @param file
       */

        private boolean deleteFile(File file) {
         if (file.exists()) {
        if (file.isFile()) {
         file.delete();
        } else if (file.isDirectory()) {
         File files[] = file.listFiles();
         for (int i = 0; i < files.length; i++) {
          this.deleteFile(files[i]);
         }
        }
        file.delete();
        return true;
       } else {
        return false;
       }
    }

     

    展开全文
  • <div><p>With https://github.com/nova-video-player/smbcli/blob/master/src/org/courville/smbcli.java test program on a Huawei B715S-23S 4G router including a SMB server I get an authentication issue ...
  • <p>Device: Moto G 4G LTE (micro sd card in use) Android: 4.4.3 Files: Folder of Final Fantasy chiptunes FileCache: Set to 512MB <p>I have two or three full logcats of the problem, but here are the ...
  • solaris10.zip

    2020-06-06 16:35:54
    gcc4g++-4.8.0,REV=2013.03.29-SunOS5.10-i386-CSW.pkg.gz libncurses5-5.9,REV=2011.11.21-SunOS5.9-i386-CSW.pkg.gz gcc4gfortran-4.8.0,REV=2013.03.29-SunOS5.10-i386-CSW.pkg.gz libpcap1-1.5.2,REV=2014.01.01...
  • apache-jmeter-5.1.1.zip

    2020-07-15 11:57:42
    其中java接口源文件模版编写详细注释 5. 新增私有lib库libprivate目录,避免与自带的lib文件冲突 6. 更新常用插件 7. windows和linux下的批量测试脚本 8. windows和linux下的批量生成html报告脚本(因两种系统编码...
  • 在系统环境:Core2 i7 3.4G双核,4G内存,window 7 64位, Sun JDK 1.6_29 64位 普通pc环境测试,IK2012具有160万字/秒(3000KB/S)的高速处理能力。 2012版本的智能分词模式支持简单的分词排歧义处理和数量词合并...
  • 环境准备系统环境:centos7 x64jdk:jdk-8u171-linux-x64maven:3.2.x以上的版本均可4g+ free disk for broker server2. 下载rocketmq3. 解压> unzip rocketmq-all-4.4.0-bin-release.zip> cd rocketmq-all-...

    []

    ①:bin_二进制安装版

    1. 环境准备

    系统环境:centos7 x64

    jdk:jdk-8u171-linux-x64

    maven:3.2.x以上的版本均可

    4g+ free disk for broker server

    2. 下载rocketmq

    3. 解压

    > unzip rocketmq-all-4.4.0-bin-release.zip

    > cd rocketmq-all-4.4.0/

    4. 根据内存修改配置(默认需要4g+4g 共8g)

    cd bin

    vim runserver.sh

    # 找到如下配置

    java_opt="${java_opt} -server -xms8g -xmx8g -xmn4g"

    # 修改成你可以接受的范围

    java_opt="${java_opt} -server -xms512m -xmx521m -xmn256m -xx:metaspacesize=128m -xx:maxmetaspacesize=320m"

    vim runbroker.sh

    # 找到如下配置

    java_opt="${java_opt} -server -xms4g -xmx4g -xmn2g -xx:metaspacesize=128m -xx:maxmetaspacesize=320m"

    # 修改成你可以接受的范围

    java_opt="${java_opt} -server -xms512m -xmx512m -xmn256m"

    4.1. 配置环境变量

    vim /etc/profile

    # 将如下配置加到最后一行

    export namesrv_addr=127.0.0.1:9876

    #立即生效环境配置

    source /etc/profile

    5. 启动 name server

    > nohup sh bin/mqnamesrv &

    #查看日志

    > tail -f ~/logs/rocketmqlogs/namesrv.log

    the name server boot success...

    6. 启动 broker

    > nohup sh bin/mqbroker -n 127.0.0.1:9876 &

    #查看日志

    > tail -f ~/logs/rocketmqlogs/broker.log

    the broker[%s, 127.0.0.1:10911] boot success...

    7.测试收发消息 send & receive messages

    注意:此处tools.sh默认(-xms1g -xmx1g),内存不够需要再次按runserver.sh/runbroker.sh方式修改

    # 修改成你可以接受的范围

    vi tools.sh

    java_opt="${java_opt} -server -xms256m -xmx256m -xmn128m"

    # export namesrv_addr=localhost:9876

    > sh bin/tools.sh org.apache.rocketmq.example.quickstart.producer

    sendresult [sendstatus=send_ok, msgid= ...

    > sh bin/tools.sh org.apache.rocketmq.example.quickstart.consumer

    consumemessagethread_%d receive new messages: [messageext...

    8. 关闭rocketmq服务 shutdown 1.broker --> 2.namesrv

    > sh bin/mqshutdown broker

    the mqbroker(36695) is running...

    send shutdown request to mqbroker(36695) ok

    > sh bin/mqshutdown namesrv

    the mqnamesrv(36664) is running...

    send shutdown request to mqnamesrv(36664) ok

    ②:docker版

    docker search rocketmq

    docker pull foxiswho/rocketmq:server-4.5.1

    docker pull foxiswho/rocketmq:broker-4.5.1

    下面的就是分步启动nameserver和broker。

    1.启动nameserver

    docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1

    2.启动broker:

    docker run -d -p 10911:10911 -p 10909:10909

    --name rmqbroker --link rmqserver:namesrv

    -e "namesrv_addr=namesrv:9876" -e "java_opts=-duser.home=/opt"

    -e "java_opt_ext=-server -xms128m -xmx128m"

    foxiswho/rocketmq:broker-4.5.1

    broker容器中默认的配置文件的路径为:`/etc/rocketmq/broker.conf`

    可以通过追加-v参数指定本机的配置文件:`-v /conf/broker.conf:/etc/rocketmq/broker.conf`

    #查看验证启动成功

    docker ps|grep rocketmq

    #测试收发

    vi tools.sh

    java_opt="${java_opt} -server -xms256m -xmx256m -xmn128m"

    进入容器内部执行shell

    发(生产者): `sh bin/tools.sh org.apache.rocketmq.example.quickstart.producer`

    收(消费者): `sh bin/tools.sh org.apache.rocketmq.example.quickstart.consumer`

    发送成功则显示:sendresult [sendstatus=send_ok, msgid= ...

    消费成功则显示:consumemessagethread_%d receive new messages: [messageext...

    ③:rocketmq-console 可视化监控服务配置

    []

    docker镜像版

    mvn clean package -dmaven.test.skip=true docker:build

    docker pull styletang/rocketmq-console-ng

    #运行

    docker run -e "java_opts=-drocketmq.namesrv.addr=127.0.0.1:9876 -dcom.rocketmq.sendmessagewithvipchannel=false" -p 8080:8080 -t styletang/rocketmq-console-ng

    maven编译普通版

    cd /usr/local/rocketmq-externals

    git clone https://github.com/apache/rocketmq-externals

    #修改配置文件

    vi /usr/local/rocketmq/rocketmq-externals/rocketmq-console/src/main/resources/application.properties

    # 修改如下相应配置

    server.port=8080 //服务端口号

    rocketmq.config.namesrvaddr=127.0.0.1:9876 //配置服务地址

    rocketmq.config.datapath=/tmp/rocketmq-console/data //mq数据路径,可以自己修改

    #使用maven打包

    cd /usr/local/rocketmq/rocketmq-externals/rocketmq-console

    mvn clean package -dmaven.test.skip=true

    mvn spring-boot:run

    #后台运行

    nohup java -jar -xms256m -xmx256m -xmn125m rocketmq-console-ng-1.0.1.jar --server.port=8080 --rocketmq.config.namesrvaddr=127.0.0.1:9876 >rocketmq-console.log 2>&1 &

    希望与广大网友互动??

    点此进行留言吧!

    展开全文
  • <p>com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/openqa/selenium/internal/FindsByClassName.class</p> <h2>Environment <p>Compilation issue so ...
  • at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at micdoodle8.mods.galacticraft.planets.asteroids.client.render...
  • rocketmq在linux上安装

    2019-07-11 16:04:30
    1.下载bin压缩包,然后解压 官网下载地址:https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip 2.mq默认使用8g内存,若...JAVA_OPT="JAVAOPT−server−Xms4g−Xmx4g−...

    1.下载bin压缩包,然后解压
    官网下载地址:https://www.apache.org/dyn/closer.cgi?path=rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip

    2.mq默认使用8g内存,若服务器内存不足,请提前修改
    2.1 修改runserver.sh

    JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g
    -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"

    2.2 修改runbroker.sh

    JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g -Xmn4g"

    2.启动命令
    说明:启动时建议再bin上级目录启动,因为会在启动的当前目录下生成日志文件nohup.out
    2.1 启动namesrv
    nohup ./bin/mqnamesrv &
    在这里插入图片描述
    显示上面的红圈内的内容,代表namesrv启动成功
    2.2 启动broker
    nohup sh ./bin/mqbroker -n localhost:9876 &
    在这里插入图片描述
    显示上面的红圈内的内容,则代表broker启动成功(此处启动比较慢,请耐心等待)

    3.关闭命令
    ./bin/mqshutdown namesrv
    ./bin/mqshutdown broker

    转载地址:https://www.cnblogs.com/qdwyg2013/p/10268795.html

    展开全文
  • java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/...
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.toshiba.pocketsphinx-VPrA29DXIucRRuO4GNnO9Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.toshiba.pocketsphinx-VPrA29DXIucRRuO4GNnO9Q==/lib/arm64, /system/lib64]]] couldn't find "libpocketsphinx_jni.so"

    日志如上,意思是libpocketsphinx_jni.so这个so库没能找到,如果确定so库的确在项目中存在,那么注意在build.gradle的defaultConfig中,是否添加了ndk的Filter,早期代码可以不加,但是现在这个如果不加就会找不到so库,装载so库的文件夹名字用逗号分隔:

     ndk {
                abiFilters "armeabi", "armeabi-v7a"
            }

     

    展开全文
  • 数据源:4G的tar.gz包,里面是zip包,zip包里面是txt文件。压缩包解析、插入habse代码已经用java实现了插入habse–java代码Configuration cfg = HbaseConfiguration.create(); Connnection conn = ConnectionFact
  • ZKM 9 (Link fixed)

    2020-11-20 21:29:37
    <div><p>http://www.mediafire.com/file/48o478udhs7rg4g/ZKMEval.zip leak by me (But it's a Eval version) Fixed: https://mega.nz/#!uUgliZKL!T-WSPggociu5nUgjh3ROcPTHW19OQF_Lzx8YoTXL6Zo</p><p>该提问...
  • SAKAI DEMO将sakai-demo-2.8.0.zip解压到E:\SAKAI目录下 修改start-sakai.bat文件中JAVA_OPTS和CATALINA_OPTS的参数,如果机器内存有4G可以不用改。 将 -server -Xmx1024m -XX:MaxNewS
  • SAKAI DEMO将sakai-demo-2.8.0.zip解压到E:\SAKAI目录下修改start-sakai.bat文件中JAVA_OPTS和CATALINA_OPTS的参数,如果机器内存有4G可以不用改。将-server -Xmx1024m -XX:MaxNewSize=256m -XX:MaxPermSize=512m改...
  • java -Xmx4G -jar otp/otp-0.14.0.jar --build ./otp/data </code></pre> <p>Output: <pre><code> 13:20:39.824 INFO (DirectTransferGenerator.java:63) Creating direct transfer edges between stops using the ...
  • 8.3项目部署

    2021-01-20 18:00:23
    内存不小于4G,需要部署的环境: Nginx负载均衡,平均地把服务分配到tomcat上。 软件能用yum安装就用yum安装,有些软件yum里版本太旧,可以把官网提供的yum库文件下载到服务器,再用yum安装。 下载这些包 本地的...
  • -Xmx4g \ -jar ~/projects/IS_Streams/DevOps/GHE/migrate/git-lfs-migrate.jar \ -s ~/projects/IS_Streams/DevOps/GHE/Streams/.git \ -d ~/projects/IS_Streams/DevOps/GHE/Streams-Test/.git \ -g git.corp...
  • 4g" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } ext { toro_latest_version = ...
  • /var/folders/rs/3g07sjxx4g7_vm810yw7bp8c0000gn/T/libturbojpeg8532646881736721004.dylib' Loaded properties from: services.properties Added interface interface loci.formats.services.POIService and ...
  • 1.9 crash on startup

    2020-11-20 21:37:47
    MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M IntCache: cache: 0, tcache: ...
  • server crash

    2020-12-27 12:56:22
    -Xincgc -Xmx4G AABB Pool Size: 2362 (132272 bytes; 0 MB) allocated, 581 (32536 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 8325, allocated: 6, ...
  • <p>java -Xms2g -Xmx4g -jar ./Snowstorm/snowstorm-4.10.2.jar --delete-indices -import ./SNOMapping/Snomed/SnomedCT_InternationalRF2_PRODUCTION_20200309T120000Z.zip --exit >snowstorm_4_10_2_launch....
  • FTBRevelationServer.zip \ -e ENABLE_RCON=true \ -e RCON_PASSWORD=********** \ -e OPS=k1ngf15h3r \ -e ENABLE_QUERY=true \ -e MAX_PLAYERS=10 \ -e ALLOW_NETHER=true \ -e ...
  • MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4G AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed ...
  • -Xmx4g -Xms4g -Xmn512m -XX:MaxPermSize=256m AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v...
  • Game doesn't Load

    2020-12-09 01:05:23
    MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M AABB Pool Size: 0 (0 bytes; ...
  • zipfile.getAbsolutePath())) {方法中总是返回false,,错误原因java.io.FileNotFoundException: /sdcard/222tclog/AlreadyUploadLog/UploadOn2016-07-29 19:49:42:488.zip: open failed: EINVAL (Invalid argument)...

空空如也

空空如也

1 2 3 4
收藏数 70
精华内容 28
关键字:

4gjavazip

java 订阅