java

Java Swing Apache POI make Word Document read only

老子叫甜甜 提交于 2021-02-19 23:10:57
问题 Hello I am creating a Swing application to create a word document. I have made use of the Apache POI Java API for this purpose. But the problem is --> How do I set the word document to be read only after creation? I have heard of java.io.File.setReadOnly() method, but I don't know how to use it in this context. Here is the code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try{ FileOutputStream outStream=new FileOutputStream("New.docx"); XWPFDocument doc =new

how whould I parse JSON with numerical object keys in Jackson JSON

浪子不回头ぞ 提交于 2021-02-19 23:10:20
问题 I just started using Jackson JSON parser, and I love it, but I've run into a problem with a JSON object I'm trying to parse. here's my current java code: public class resetPassword { private String id; private String key1; private String key2; public String getId() { return id; } public void setId(String id) { this.id= id; } public String getKey1() { return key1; } public void setKey1(String key1) { this.key1= key1; } public String getKey2() { return key2; } public void setKey2(String key2) {

how whould I parse JSON with numerical object keys in Jackson JSON

廉价感情. 提交于 2021-02-19 23:10:04
问题 I just started using Jackson JSON parser, and I love it, but I've run into a problem with a JSON object I'm trying to parse. here's my current java code: public class resetPassword { private String id; private String key1; private String key2; public String getId() { return id; } public void setId(String id) { this.id= id; } public String getKey1() { return key1; } public void setKey1(String key1) { this.key1= key1; } public String getKey2() { return key2; } public void setKey2(String key2) {

how whould I parse JSON with numerical object keys in Jackson JSON

时间秒杀一切 提交于 2021-02-19 23:09:08
问题 I just started using Jackson JSON parser, and I love it, but I've run into a problem with a JSON object I'm trying to parse. here's my current java code: public class resetPassword { private String id; private String key1; private String key2; public String getId() { return id; } public void setId(String id) { this.id= id; } public String getKey1() { return key1; } public void setKey1(String key1) { this.key1= key1; } public String getKey2() { return key2; } public void setKey2(String key2) {

Java Swing Apache POI make Word Document read only

二次信任 提交于 2021-02-19 23:08:36
问题 Hello I am creating a Swing application to create a word document. I have made use of the Apache POI Java API for this purpose. But the problem is --> How do I set the word document to be read only after creation? I have heard of java.io.File.setReadOnly() method, but I don't know how to use it in this context. Here is the code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try{ FileOutputStream outStream=new FileOutputStream("New.docx"); XWPFDocument doc =new

Java Swing Apache POI make Word Document read only

旧城冷巷雨未停 提交于 2021-02-19 23:08:26
问题 Hello I am creating a Swing application to create a word document. I have made use of the Apache POI Java API for this purpose. But the problem is --> How do I set the word document to be read only after creation? I have heard of java.io.File.setReadOnly() method, but I don't know how to use it in this context. Here is the code: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try{ FileOutputStream outStream=new FileOutputStream("New.docx"); XWPFDocument doc =new

JVM

放肆的年华 提交于 2021-02-19 22:46:17
纯解释执行(启动很快,执行很慢) -Xint 纯编译执行(启动很慢,执行很快) -Xcomp 混合执行(默认) -Xmixed 设置热点代码(JVM使用编译执行的条件) -XX:CompileThreshold=10000 测试 public class MyTest { public static void main(String[] args) { long t1 = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { myLoop(); } long t2 = System.currentTimeMillis(); System.out.println(t2 - t1); } public static void myLoop(){ for (int i = 0; i < 1000000; i++) { int j = i / 2; } } } 三种模式分别测试的结果: 纯解释: 实在太久,直接放弃...... 纯编译: 有一定的编译时间, 执行时间为 2 混合: 编译很快, 执行时间为 5 来源: oschina 链接: https://my.oschina.net/icefoxhz/blog/4956878

Remove XMP Metadata on PDF/A

本秂侑毒 提交于 2021-02-19 22:38:38
问题 Is there a way wherein we can remove XMP metadata on a PDF/A Document without removing the PDF/A standardization? I found that using PdfReader reader = new PdfReader(src); PdfDictionary dict = reader.getCatalog(); dict.remove(PdfName.METADATA); dict.remove(PdfName.PROPERTIES); reader.removeUnusedObjects(); Removes both XMP and PDF/A. Is there a way to remove the XMP while retaining the standard or reintroducing PDF/A into the processed document? Thanks. 回答1: You can't remove the XMP

Remove XMP Metadata on PDF/A

左心房为你撑大大i 提交于 2021-02-19 22:34:28
问题 Is there a way wherein we can remove XMP metadata on a PDF/A Document without removing the PDF/A standardization? I found that using PdfReader reader = new PdfReader(src); PdfDictionary dict = reader.getCatalog(); dict.remove(PdfName.METADATA); dict.remove(PdfName.PROPERTIES); reader.removeUnusedObjects(); Removes both XMP and PDF/A. Is there a way to remove the XMP while retaining the standard or reintroducing PDF/A into the processed document? Thanks. 回答1: You can't remove the XMP

Remove XMP Metadata on PDF/A

若如初见. 提交于 2021-02-19 22:30:42
问题 Is there a way wherein we can remove XMP metadata on a PDF/A Document without removing the PDF/A standardization? I found that using PdfReader reader = new PdfReader(src); PdfDictionary dict = reader.getCatalog(); dict.remove(PdfName.METADATA); dict.remove(PdfName.PROPERTIES); reader.removeUnusedObjects(); Removes both XMP and PDF/A. Is there a way to remove the XMP while retaining the standard or reintroducing PDF/A into the processed document? Thanks. 回答1: You can't remove the XMP