// Create or Update the Property Set stream in the POIFS
outFS.createOrUpdateDocument(bIn, name);
- logger.log(POILogger.INFO, "Wrote property set " + name + " of size " + data.length);
+ logger.log(POILogger.INFO, "Wrote property set ", name, " of size ", data.length);
} catch(WritingNotSupportedException ignored) {
- logger.log( POILogger.ERROR, "Couldn't write property set with name " + name + " as not supported by HPSF yet");
+ logger.log( POILogger.ERROR, "Couldn't write property set with name ", name, " as not supported by HPSF yet");
}
}
try {
cps = CodePageUtil.codepageToEncoding(cp, false);
} catch (UnsupportedEncodingException e) {
- LOG.log(POILogger.ERROR, "Codepage '"+cp+"' can't be found.");
+ LOG.log(POILogger.ERROR, "Codepage '", cp, "' can't be found.");
}
if (!cps.isEmpty() && Charset.forName(cps).newEncoder().canEncode(value)) {
return;
try {
hasNext = recStream.hasNextRecord();
} catch (LeftoverDataException e) {
- logger.log(POILogger.ERROR, "Discarding " + recStream.remaining() + " bytes and continuing", e);
+ logger.log(POILogger.ERROR, "Discarding ", recStream.remaining(), " bytes and continuing", e);
recStream.readRemainder();
hasNext = recStream.hasNextRecord();
}
if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex));
if (tfr == null) {
- logger.log( POILogger.ERROR, "Requested format at index " + formatIndex
- + ", but it wasn't found");
+ logger.log( POILogger.ERROR, "Requested format at index ", formatIndex,
+ ", but it wasn't found");
} else {
format = tfr.getFormatString();
}
public int getFormatIndex(CellValueRecordInterface cell) {
ExtendedFormatRecord xfr = _xfRecords.get(cell.getXFIndex());
if (xfr == null) {
- logger.log( POILogger.ERROR, "Cell " + cell.getRow() + "," + cell.getColumn()
- + " uses XF with index " + cell.getXFIndex() + ", but we don't have that");
+ logger.log( POILogger.ERROR, "Cell ", cell.getRow(), ",", cell.getColumn(),
+ " uses XF with index ", cell.getXFIndex(), ", but we don't have that");
return -1;
}
return xfr.getFormatIndex();
int nUnexpectedPadding = remaining - dataLenAfterFormula;
if (nUnexpectedPadding > 0) {
- logger.log( POILogger.ERROR, "Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
+ logger.log( POILogger.ERROR, "Discarding ", nUnexpectedPadding, " unexpected padding bytes");
readRawData(in, nUnexpectedPadding);
remaining-=nUnexpectedPadding;
}
sharedFeature = new FeatSmartTag(in);
break;
default:
- logger.log( POILogger.ERROR, "Unknown Shared Feature " + isf_sharedFeatureType + " found!");
+ logger.log( POILogger.ERROR, "Unknown Shared Feature ", isf_sharedFeatureType, " found!");
}
}
for (int i=0;i<stringCount;i++) {
// Extract exactly the count of strings from the SST record.
UnicodeString str;
- if(in.available() == 0 && ! in.hasNextRecord()) {
- logger.log( POILogger.ERROR, "Ran out of data before creating all the strings! String at index " + i + "");
- str = new UnicodeString("");
- } else {
- str = new UnicodeString(in);
- }
+ if (in.available() == 0 && !in.hasNextRecord()) {
+ logger.log(POILogger.ERROR, "Ran out of data before creating all the strings! String at index ", i);
+ str = new UnicodeString("");
+ } else {
+ str = new UnicodeString(in);
+ }
addToStringTable( strings, str );
}
}
static public void addToStringTable( IntMapper<UnicodeString> strings, UnicodeString string )
{
- strings.add(string);
+ strings.add(string);
}
}
}
if (!fileOut.delete()) {
- LOG.log(POILogger.ERROR, "Can't delete temporary encryption file: "+fileOut);
+ LOG.log(POILogger.ERROR, "Can't delete temporary encryption file: ", fileOut);
}
} catch (IOException e) {
throw new EncryptedDocumentException(e);
IOUtils.copy(fis, leos);
}
if (!fileOut.delete()) {
- logger.log(POILogger.ERROR, "Can't delete temporary encryption file: "+fileOut);
+ logger.log(POILogger.ERROR, "Can't delete temporary encryption file: ", fileOut);
}
leos.close();
loc = LocaleID.lookupByLanguageTag(languageTag.substring(0, idx));
}
if (loc == null) {
- logger.log( POILogger.ERROR, "Unable to find prefix for Locale '" + languageTag + "' or its parent locales." );
+ logger.log( POILogger.ERROR, "Unable to find prefix for Locale '", languageTag, "' or its parent locales." );
return "";
}
}
try {
result = Integer.parseInt(property);
} catch (Exception e) {
- logger.log(POILogger.ERROR, "System property -D"+systemProperty +" do not contains a valid integer " + property);
+ logger.log(POILogger.ERROR, "System property -D", systemProperty, " does not contains a valid integer: ", property);
}
return result;
}
try {
closeable.close();
} catch ( Exception exc ) {
- logger.log( POILogger.ERROR, "Unable to close resource: " + exc,
+ logger.log( POILogger.ERROR, "Unable to close resource: ", exc,
exc );
}
}
if (!check(level)) {
return;
}
- System.out.println("[" + _cat + "]" + LEVEL_STRINGS_SHORT.charAt(Math.min(LEVEL_STRINGS_SHORT.length()-1, level)) + " " + obj1);
+ System.out.print("[");
+ System.out.print(_cat);
+ System.out.print("]");
+ System.out.print(LEVEL_STRINGS_SHORT.charAt(Math.min(LEVEL_STRINGS_SHORT.length()-1, level)));
+ System.out.print(" ");
+ System.out.println(obj1);
if (exception != null) {
exception.printStackTrace(System.out);
}
final PackagePart p = packagePart.getPackage().getPart(relName);
if (p == null) {
- logger.log(POILogger.ERROR, "Skipped invalid entry " + rel.getTargetURI());
+ logger.log(POILogger.ERROR, "Skipped invalid entry ", rel.getTargetURI());
continue;
}
sourcePartName = PackagingURIHelper.createPartName(sourceURI);
} catch (InvalidFormatException e) {
logger
- .log(POILogger.ERROR, "Part name URI '"
- + sourceURI
- + "' is not valid ! This message is not intended to be displayed !");
+ .log(POILogger.ERROR, "Part name URI '", sourceURI,
+ "' is not valid ! This message is not intended to be displayed !");
return;
}
if (sourcePartName.getURI().equals(
// package
target = PackagingURIHelper.toURI(value);
} catch (URISyntaxException e) {
- logger.log(POILogger.ERROR, "Cannot convert " + value
- + " in a valid relationship URI-> dummy-URI used", e);
+ logger.log(POILogger.ERROR, "Cannot convert ", value,
+ " in a valid relationship URI-> dummy-URI used", e);
}
addRelationship(target, targetMode, type, id);
}
throw new InvalidOperationException("Can't open the specified file: '" + file + "'", e);
}
- LOG.log(POILogger.ERROR, "Error in zip file "+file+" - falling back to stream processing (i.e. ignoring zip central directory)");
+ LOG.log(POILogger.ERROR, "Error in zip file ", file, " - falling back to stream processing (i.e. ignoring zip central directory)");
ze = openZipEntrySourceStream(file);
}
this.zipArchive = ze;
zos.closeArchiveEntry();
}
} catch (IOException ioe) {
- logger.log(POILogger.ERROR, "Cannot write: " + CONTENT_TYPES_PART_NAME
- + " in Zip !", ioe);
+ logger.log(POILogger.ERROR, "Cannot write: ", CONTENT_TYPES_PART_NAME,
+ " in Zip !", ioe);
return false;
}
}
public boolean marshall(PackagePart part, OutputStream os)
throws OpenXML4JException {
if (!(os instanceof ZipArchiveOutputStream)) {
- logger.log(POILogger.ERROR,"Unexpected class " + os.getClass().getName());
+ logger.log(POILogger.ERROR,"Unexpected class ", os.getClass().getName());
throw new OpenXML4JException("ZipOutputStream expected !");
// Normally should happen only in development phase, so just throw
// exception
zos.closeArchiveEntry();
}
} catch (IOException ioe) {
- logger.log(POILogger.ERROR,"Cannot write: " + part.getPartName() + ": in ZIP",
+ logger.log(POILogger.ERROR,"Cannot write: ", part.getPartName(), ": in ZIP",
ioe);
return false;
}
zos.closeArchiveEntry();
}
} catch (IOException e) {
- logger.log(POILogger.ERROR,"Cannot create zip entry " + relPartName, e);
+ logger.log(POILogger.ERROR,"Cannot create zip entry ", relPartName, e);
return false;
}
}
@Override
public void init(XMLStructure parent, XMLCryptoContext context) throws InvalidAlgorithmParameterException {
LOG.log(POILogger.DEBUG, "init(parent,context)");
- LOG.log(POILogger.DEBUG, "parent java type: " + parent.getClass().getName());
+ LOG.log(POILogger.DEBUG, "parent java type: ", parent.getClass().getName());
DOMStructure domParent = (DOMStructure) parent;
Node parentNode = domParent.getNode();
int statusCode = huc.getResponseCode();
if (statusCode != 200) {
- LOG.log(POILogger.ERROR, "Error contacting TSP server ", signatureConfig.getTspUrl() +
- ", had status code " + statusCode + "/" + huc.getResponseMessage());
+ LOG.log(POILogger.ERROR, "Error contacting TSP server ", signatureConfig.getTspUrl(),
+ ", had status code ", statusCode, "/", huc.getResponseMessage());
throw new IOException("Error contacting TSP server " + signatureConfig.getTspUrl() +
", had status code " + statusCode + "/" + huc.getResponseMessage());
}
} else if (props instanceof CTTextCharacterProperties) {
obj = new TextCharDelegate((CTTextCharacterProperties)props);
} else {
- LOG.log(POILogger.ERROR, props.getClass() +" is an unknown properties type");
+ LOG.log(POILogger.ERROR, props.getClass(), " is an unknown properties type");
return null;
}
thisStr = rtss.toString();
}
catch (NumberFormatException ex) {
- logger.log(POILogger.ERROR, "Failed to parse SST index '" + sstIndex, ex);
+ logger.log(POILogger.ERROR, "Failed to parse SST index '", sstIndex, ex);
}
break;
@Override
protected void finalize() throws Throwable {
if (_fd.exists() && !_fd.delete()) {
- logger.log(POILogger.ERROR, "Can't delete temporary encryption file: "+_fd);
+ logger.log(POILogger.ERROR, "Can't delete temporary encryption file: ", _fd);
}
}
break;
}
}
- logger.log(POILogger.ERROR, "Can't find drawing with id=" + ctDrawing.getId() + " in the list of the sheet's relationships");
+ logger.log(POILogger.ERROR, "Can't find drawing with id=", ctDrawing.getId(), " in the list of the sheet's relationships");
}
return null;
}
}
}
if(drawing == null){
- logger.log(POILogger.ERROR, "Can't find VML drawing with id=" + id + " in the list of the sheet's relationships");
+ logger.log(POILogger.ERROR, "Can't find VML drawing with id=", id, " in the list of the sheet's relationships");
}
}
return drawing;
data, endOfDataPos);
endOfDataPos += 8;
} else {
- logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the trailer in the data (" + data.length + ")");
+ logger.log(POILogger.ERROR, "Header claims a length to ", endOfDataPos, " there's then no space for the trailer in the data (", data.length, ")");
}
}
if(header.hasSeparator()) {
separator = new ChunkSeparator(
data, endOfDataPos);
} else {
- logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the separator in the data (" + data.length + ")");
+ logger.log(POILogger.ERROR, "Header claims a length to ", endOfDataPos, " there's then no space for the separator in the data (", data.length, ")");
}
}
}
catch (Exception e)
{
- logger.log(POILogger.ERROR, "Failed to create chunk at " + pos + ", ignoring rest of data." + e);
+ logger.log(POILogger.ERROR, "Failed to create chunk at ", pos, ", ignoring rest of data." + e);
}
chunks = chunksA.toArray(new Chunk[0]);
out.write(chunk, 0, lastLen);
}
// End of picture marker for PICT is 0x00 0xFF
- LOG.log(POILogger.ERROR, "PICT zip-stream is invalid, read as much as possible. Uncompressed length of header: " + header.getWmfSize() + " / Read bytes: " + out.size(), e);
+ LOG.log(POILogger.ERROR, "PICT zip-stream is invalid, read as much as possible. Uncompressed length of header: ", header.getWmfSize(), " / Read bytes: ", out.size(), e);
}
return out.toByteArray();
}
if(_children[0] instanceof AnimationInfoAtom) {
animationAtom = (AnimationInfoAtom)_children[0];
} else {
- logger.log(POILogger.ERROR, "First child record wasn't a AnimationInfoAtom, was of type " + _children[0].getRecordType());
+ logger.log(POILogger.ERROR, "First child record wasn't a AnimationInfoAtom, was of type ", _children[0].getRecordType());
}
}
if(_children[0] instanceof ExEmbedAtom) {
embedAtom = (ExEmbedAtom)_children[0];
} else {
- logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type " + _children[0].getRecordType());
+ logger.log(POILogger.ERROR, "First child record wasn't a ExEmbedAtom, was of type ", _children[0].getRecordType());
}
// Second child should be the ExOleObjAtom
if (_children[1] instanceof ExOleObjAtom) {
oleObjAtom = (ExOleObjAtom)_children[1];
} else {
- logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type " + _children[1].getRecordType());
+ logger.log(POILogger.ERROR, "Second child record wasn't a ExOleObjAtom, was of type ", _children[1].getRecordType());
}
for (int i = 2; i < _children.length; i++) {
if(_children[0] instanceof ExHyperlinkAtom) {
linkAtom = (ExHyperlinkAtom)_children[0];
} else {
- logger.log(POILogger.ERROR, "First child record wasn't a ExHyperlinkAtom, was of type " + _children[0].getRecordType());
+ logger.log(POILogger.ERROR, "First child record wasn't a ExHyperlinkAtom, was of type ", _children[0].getRecordType());
}
for (int i = 1; i < _children.length; i++) {
if ( linkDetailsA == null) linkDetailsA = (CString)_children[i];
else linkDetailsB = (CString)_children[i];
} else {
- logger.log(POILogger.ERROR, "Record after ExHyperlinkAtom wasn't a CString, was of type " + _children[1].getRecordType());
+ logger.log(POILogger.ERROR, "Record after ExHyperlinkAtom wasn't a CString, was of type ", _children[1].getRecordType());
}
}
if(_children[0] instanceof ExMediaAtom) {
mediaAtom = (ExMediaAtom)_children[0];
} else {
- logger.log(POILogger.ERROR, "First child record wasn't a ExMediaAtom, was of type " + _children[0].getRecordType());
+ logger.log(POILogger.ERROR, "First child record wasn't a ExMediaAtom, was of type ", _children[0].getRecordType());
}
if(_children[1] instanceof CString) {
pathAtom = (CString)_children[1];
} else {
- logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type " + _children[1].getRecordType());
+ logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type ", _children[1].getRecordType());
}
}
if(_children[0] instanceof CString) {
_name = (CString)_children[0];
} else {
- logger.log(POILogger.ERROR, "First child record wasn't a CString, was of type " + _children[0].getRecordType());
+ logger.log(POILogger.ERROR, "First child record wasn't a CString, was of type ", _children[0].getRecordType());
}
// Second child should be the ExOleObjAtom
if (_children[1] instanceof CString) {
_type = (CString)_children[1];
} else {
- logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type " + _children[1].getRecordType());
+ logger.log(POILogger.ERROR, "Second child record wasn't a CString, was of type ", _children[1].getRecordType());
}
for (int i = 2; i < _children.length; i++) {
// Get the record data.
read(leis);
} catch (IOException e){
- logger.log(POILogger.ERROR, "Failed to parse TextRulerAtom: " + e.getMessage());
+ logger.log(POILogger.ERROR, "Failed to parse TextRulerAtom: ", e.getMessage());
}
}
} else {
// Should we do anything special with these non
// Container records?
- LOG.log(POILogger.ERROR, "Shape contained non container escher record, was " + r.getClass().getName());
+ LOG.log(POILogger.ERROR, "Shape contained non container escher record, was ", r.getClass().getName());
}
}
return pd;
}
}
- LOG.log(POILogger.ERROR, "no picture found for our BSE offset " + bse.getOffset());
+ LOG.log(POILogger.ERROR, "no picture found for our BSE offset ", bse.getOffset());
}
return null;
}
return _mostRecentCoreRecords[coreRecordId];
}
logger.log(POILogger.ERROR,
- "We tried to look up a reference to a core record, but there was no core ID for reference ID "
- + refID);
+ "We tried to look up a reference to a core record, but there was no core ID for reference ID ", refID);
return null;
}
// Ensure it really is a notes record
if (!(r instanceof Notes)) {
- logger.log(POILogger.ERROR, loggerLoc+", but that was actually a " + r);
+ logger.log(POILogger.ERROR, loggerLoc, ", but that was actually a ", r);
continue;
}
// Ensure it really is a slide record
if (!(r instanceof Slide)) {
- logger.log(POILogger.ERROR, "A Slide SlideAtomSet at " + idx
- + " said its record was at refID "
- + spa.getRefID()
- + ", but that was actually a " + r);
+ logger.log(POILogger.ERROR, "A Slide SlideAtomSet at ", idx,
+ " said its record was at refID ",
+ spa.getRefID(),
+ ", but that was actually a ", r);
continue;
}
if (notesPos != null && 0 <= notesPos && notesPos < _notes.size()) {
notes = _notes.get(notesPos);
} else {
- logger.log(POILogger.ERROR, "Notes not found for noteId=" + noteId);
+ logger.log(POILogger.ERROR, "Notes not found for noteId=", noteId);
}
}
try {
currentUser = new CurrentUserAtom(getDirectory());
} catch (IOException ie) {
- logger.log(POILogger.ERROR, "Error finding Current User Atom:\n" + ie);
+ logger.log(POILogger.ERROR, "Error finding Current User Atom", ie);
currentUser = new CurrentUserAtom();
}
}
// If they type (including the bonus 0xF018) is 0, skip it
PictureType pt = PictureType.forNativeID(type - 0xF018);
if (pt == null) {
- logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length " + imgsize + ".\nYou document will probably become corrupted if you save it!");
- logger.log(POILogger.ERROR, "" + pos);
+ logger.log(POILogger.ERROR, "Problem reading picture: Invalid image type 0, on picture with length ", imgsize, ".\nYou document will probably become corrupted if you save it!");
+ logger.log(POILogger.ERROR, "position: ", pos);
} else {
//The pictstream can be truncated halfway through a picture.
//This is not a problem if the pictstream contains extra pictures
pict.setIndex(_pictures.size());
_pictures.add(pict);
} catch (IllegalArgumentException e) {
- logger.log(POILogger.ERROR, "Problem reading picture: " + e + "\nYou document will probably become corrupted if you save it!");
+ logger.log(POILogger.ERROR, "Problem reading picture: ", e, "\nYou document will probably become corrupted if you save it!");
}
}
} else if (chunk instanceof DirectoryChunk) {
attachmentDirectory = (DirectoryChunk) chunk;
} else {
- LOG.log(POILogger.ERROR, "Unexpected data chunk of type " + chunk.getEntryName());
+ LOG.log(POILogger.ERROR, "Unexpected data chunk of type ", chunk.getEntryName());
}
} else if (chunkId == ATTACH_EXTENSION.id) {
attachExtension = (StringChunk) chunk;
try {
recipientNumber = Integer.parseInt(number, 16);
} catch (NumberFormatException e) {
- LOG.log(POILogger.ERROR,
- "Invalid recipient number in name " + name);
+ LOG.log(POILogger.ERROR, "Invalid recipient number in name ", name);
}
}
}
try (DocumentInputStream inp = new DocumentInputStream((DocumentNode) entry)) {
chunk.readValue(inp);
} catch (IOException e) {
- LOG.log(POILogger.ERROR, "Error reading from part " + entry.getName(), e);
+ LOG.log(POILogger.ERROR, "Error reading from part ", entry.getName(), e);
}
}
{
logger.log(
POILogger.ERROR,
- "Unable to apply SPRM operation '"
- + sprm.getOperation() + "': ", exc );
+ "Unable to apply SPRM operation '", sprm.getOperation(), "': ", exc );
}
}
}