public void setCreated(Optional<Date> date) {
part.setCreatedProperty(date);
}
- public void setCreated(String date) {
+ public void setCreated(String date) throws InvalidFormatException {
part.setCreatedProperty(date);
}
public String getCreator() {
public void setLastPrinted(Optional<Date> date) {
part.setLastPrintedProperty(date);
}
- public void setLastPrinted(String date) {
+ public void setLastPrinted(String date) throws InvalidFormatException {
part.setLastPrintedProperty(date);
}
/** @since POI 3.15 beta 3 */
public void setModified(Optional<Date> date) {
part.setModifiedProperty(date);
}
- public void setModified(String date) {
+ public void setModified(String date) throws InvalidFormatException {
part.setModifiedProperty(date);
}
public String getSubject() {
package org.apache.poi.openxml4j.opc;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+
import java.util.Date;
import java.util.Optional;
/**
* Set the date of creation of the resource.
+ * @throws InvalidFormatException only since POI 5.2.0, used to throw unchecked exception
+ * IllegalArgumentException if format was invalid
*/
- void setCreatedProperty(String created);
+ void setCreatedProperty(String created) throws InvalidFormatException;
/**
* Set the date of creation of the resource.
/**
* Set the date and time of the last printing.
+ * @throws InvalidFormatException only since POI 5.2.0, used to throw unchecked exception
+ * IllegalArgumentException if format was invalid
*/
- void setLastPrintedProperty(String lastPrinted);
+ void setLastPrintedProperty(String lastPrinted) throws InvalidFormatException;
/**
* Set the date and time of the last printing.
/**
* Set the date on which the resource was changed.
+ * @throws InvalidFormatException only since POI 5.2.0, used to throw unchecked exception
+ * IllegalArgumentException if format was invalid
*/
- void setModifiedProperty(String modified);
+ void setModifiedProperty(String modified) throws InvalidFormatException;
/**
* Set the date on which the resource was changed.
* @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatedProperty(java.util.Optional)
*/
@Override
- public void setCreatedProperty(String created) {
- try {
- this.created = parseDateValue(created);
- } catch (InvalidFormatException e) {
- throw new IllegalArgumentException("Date for created could not be parsed: " + created, e);
- }
+ public void setCreatedProperty(String created) throws InvalidFormatException {
+ this.created = parseDateValue(created);
}
/**
* @see org.apache.poi.openxml4j.opc.PackageProperties#setLastPrintedProperty(java.util.Optional)
*/
@Override
- public void setLastPrintedProperty(String lastPrinted) {
- try {
- this.lastPrinted = parseDateValue(lastPrinted);
- } catch (InvalidFormatException e) {
- throw new IllegalArgumentException("lastPrinted : "
- + e.getLocalizedMessage(), e);
- }
+ public void setLastPrintedProperty(String lastPrinted) throws InvalidFormatException {
+ this.lastPrinted = parseDateValue(lastPrinted);
}
/**
* @see org.apache.poi.openxml4j.opc.PackageProperties#setModifiedProperty(java.util.Optional)
*/
@Override
- public void setModifiedProperty(String modified) {
- try {
- this.modified = parseDateValue(modified);
- } catch (InvalidFormatException e) {
- throw new IllegalArgumentException("modified : "
- + e.getLocalizedMessage(), e);
- }
+ public void setModifiedProperty(String modified) throws InvalidFormatException {
+ this.modified = parseDateValue(modified);
}
/**