aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2015-09-01 19:19:55 +0000
committerNick Burch <nick@apache.org>2015-09-01 19:19:55 +0000
commit4ba61ccb7e43e8b8f853451c2e5c1ce175031cb1 (patch)
treee7d3e6686726f9fe55d482d1f31e2223804b5b44
parent97a530aa6e14fe9f621112ea24a14c73cf82003e (diff)
downloadpoi-4ba61ccb7e43e8b8f853451c2e5c1ce175031cb1.tar.gz
poi-4ba61ccb7e43e8b8f853451c2e5c1ce175031cb1.zip
Fix some Forbidden APIs errors
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700648 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java7
-rw-r--r--src/java/org/apache/poi/hssf/record/HyperlinkRecord.java5
-rw-r--r--src/java/org/apache/poi/hssf/record/WriteAccessRecord.java4
3 files changed, 4 insertions, 12 deletions
diff --git a/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java b/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java
index ca35c631b5..94ba90bed4 100644
--- a/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java
+++ b/src/java/org/apache/poi/hssf/dev/BiffDrawingToXml.java
@@ -35,15 +35,12 @@ import org.apache.poi.hssf.record.EscherAggregate;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
+import org.apache.poi.util.StringUtil;
/**
* Utility for representing drawings contained in a binary Excel file as a XML tree
- *
- * @author Evgeniy Berlog
- * date: 10.04.12
*/
public class BiffDrawingToXml {
-
private static final String SHEET_NAME_PARAM = "-sheet-name";
private static final String SHEET_INDEXES_PARAM = "-sheet-indexes";
private static final String EXCLUDE_WORKBOOK_RECORDS = "-exclude-workbook";
@@ -163,7 +160,7 @@ public class BiffDrawingToXml {
}
}
builder.append("</workbook>\n");
- fos.write(builder.toString().getBytes());
+ fos.write(builder.toString().getBytes(StringUtil.UTF8));
fos.close();
}
diff --git a/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java b/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
index 07466f06e3..471c1752a7 100644
--- a/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
+++ b/src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
@@ -35,9 +35,6 @@ import org.apache.poi.util.StringUtil;
* The <code>HyperlinkRecord</code> (0x01B8) wraps an HLINK-record
* from the Excel-97 format.
* Supports only external links for now (eg http://)
- *
- * @author Mark Hissink Muller <a href="mailto:mark@hissinkmuller.nl >mark&064;hissinkmuller.nl</a>
- * @author Yegor Kozlov (yegor at apache dot org)
*/
public final class HyperlinkRecord extends StandardRecord {
public final static short sid = 0x01B8;
@@ -521,7 +518,7 @@ public final class HyperlinkRecord extends StandardRecord {
byte[] path_bytes = new byte[len];
in.readFully(path_bytes);
- _address = new String(path_bytes);
+ _address = new String(path_bytes, StringUtil.UTF8);
}
}
diff --git a/src/java/org/apache/poi/hssf/record/WriteAccessRecord.java b/src/java/org/apache/poi/hssf/record/WriteAccessRecord.java
index 130f266c39..d62a15017d 100644
--- a/src/java/org/apache/poi/hssf/record/WriteAccessRecord.java
+++ b/src/java/org/apache/poi/hssf/record/WriteAccessRecord.java
@@ -31,8 +31,6 @@ import org.apache.poi.util.StringUtil;
* <p/>
* REFERENCE: PG 424 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
* <p/>
- *
- * @author Andrew C. Oliver (acoliver at apache dot org)
*/
public final class WriteAccessRecord extends StandardRecord {
public final static short sid = 0x005C;
@@ -68,7 +66,7 @@ public final class WriteAccessRecord extends StandardRecord {
LittleEndian.putUShort(data, 0, nChars);
LittleEndian.putByte(data, 2, is16BitFlag);
in.readFully(data, 3, data.length-3);
- String rawValue = new String(data);
+ String rawValue = new String(data, StringUtil.UTF8);
setUsername(rawValue.trim());
return;
}