// Java wants M not m for month
format = format.replace('m','M');
// Change \- into -, if it's there
- format = format.replace("\\-","-");
+ format = format.replaceAll("\\\\-","-");
// Format as a date
Date d = HSSFDateUtil.getJavaDate(value);
System.out.println(ind + " Length is\t" + ptr.getLength() +
" - " + Integer.toHexString(ptr.getLength()));
System.out.println(ind + " Compressed is\t" + ptr.destinationCompressed());
- System.out.println(ind + " Stream is\t" + stream.getClass().getCanonicalName());
+ System.out.println(ind + " Stream is\t" + stream.getClass().getName());
byte[] db = stream._getStore()._getContents();
String ds = "";
--- /dev/null
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+\r
+\r
+package org.apache.poi.hdgf.exceptions;\r
+\r
+/**\r
+ * The superclass of all HDGF exceptions\r
+ *\r
+ * @author Yegor Kozlov\r
+ */\r
+public class HDGFException extends RuntimeException {\r
+\r
+ public HDGFException() {\r
+ super();\r
+ }\r
+\r
+ public HDGFException(String message) {\r
+ super(message);\r
+ }\r
+\r
+ public HDGFException(String message, Throwable cause) {\r
+ super(message, cause);\r
+ }\r
+\r
+ public HDGFException(Throwable cause) {\r
+ super(cause);\r
+ }\r
+\r
+}\r
import org.apache.poi.hdgf.chunks.ChunkFactory;
import org.apache.poi.hdgf.pointers.Pointer;
import org.apache.poi.hdgf.pointers.PointerFactory;
+import org.apache.poi.hdgf.exceptions.HDGFException;
/**
* Base of all Streams within a HDGF document.
);
} catch(IOException e) {
// Should never occur
- throw new IllegalStateException(e);
+ throw new HDGFException(e);
}
} else {
store = new StreamStore(