Fix some Forbidden APIs errors

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1700648 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-09-01 19:19:55 +00:00
parent 46eccc04cc
commit 8265e2e95e
3 changed files with 4 additions and 12 deletions

View File

@ -35,15 +35,12 @@ import org.apache.poi.hssf.record.EscherAggregate;
import org.apache.poi.hssf.usermodel.HSSFPatriarch; import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; 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 * Utility for representing drawings contained in a binary Excel file as a XML tree
*
* @author Evgeniy Berlog
* date: 10.04.12
*/ */
public class BiffDrawingToXml { public class BiffDrawingToXml {
private static final String SHEET_NAME_PARAM = "-sheet-name"; private static final String SHEET_NAME_PARAM = "-sheet-name";
private static final String SHEET_INDEXES_PARAM = "-sheet-indexes"; private static final String SHEET_INDEXES_PARAM = "-sheet-indexes";
private static final String EXCLUDE_WORKBOOK_RECORDS = "-exclude-workbook"; private static final String EXCLUDE_WORKBOOK_RECORDS = "-exclude-workbook";
@ -163,7 +160,7 @@ public class BiffDrawingToXml {
} }
} }
builder.append("</workbook>\n"); builder.append("</workbook>\n");
fos.write(builder.toString().getBytes()); fos.write(builder.toString().getBytes(StringUtil.UTF8));
fos.close(); fos.close();
} }

View File

@ -35,9 +35,6 @@ import org.apache.poi.util.StringUtil;
* The <code>HyperlinkRecord</code> (0x01B8) wraps an HLINK-record * The <code>HyperlinkRecord</code> (0x01B8) wraps an HLINK-record
* from the Excel-97 format. * from the Excel-97 format.
* Supports only external links for now (eg http://) * 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 class HyperlinkRecord extends StandardRecord {
public final static short sid = 0x01B8; public final static short sid = 0x01B8;
@ -521,7 +518,7 @@ public final class HyperlinkRecord extends StandardRecord {
byte[] path_bytes = new byte[len]; byte[] path_bytes = new byte[len];
in.readFully(path_bytes); in.readFully(path_bytes);
_address = new String(path_bytes); _address = new String(path_bytes, StringUtil.UTF8);
} }
} }

View File

@ -31,8 +31,6 @@ import org.apache.poi.util.StringUtil;
* <p/> * <p/>
* REFERENCE: PG 424 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2) * REFERENCE: PG 424 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
* <p/> * <p/>
*
* @author Andrew C. Oliver (acoliver at apache dot org)
*/ */
public final class WriteAccessRecord extends StandardRecord { public final class WriteAccessRecord extends StandardRecord {
public final static short sid = 0x005C; public final static short sid = 0x005C;
@ -68,7 +66,7 @@ public final class WriteAccessRecord extends StandardRecord {
LittleEndian.putUShort(data, 0, nChars); LittleEndian.putUShort(data, 0, nChars);
LittleEndian.putByte(data, 2, is16BitFlag); LittleEndian.putByte(data, 2, is16BitFlag);
in.readFully(data, 3, data.length-3); in.readFully(data, 3, data.length-3);
String rawValue = new String(data); String rawValue = new String(data, StringUtil.UTF8);
setUsername(rawValue.trim()); setUsername(rawValue.trim());
return; return;
} }