mirror of https://github.com/apache/poi.git
[bug-56155] support version property in CoreProperties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1901356 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
772c938f4c
commit
30bca4da83
|
@ -345,6 +345,25 @@ public class POIXMLProperties {
|
|||
public String getTitle() {
|
||||
return part.getTitleProperty().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the version property.
|
||||
* @param version property value
|
||||
* @since POI 5.2.3
|
||||
*/
|
||||
public void setVersion(String version) {
|
||||
part.setVersionProperty(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version property value.
|
||||
* @return version property (can be null)
|
||||
* @since POI 5.2.3
|
||||
*/
|
||||
public String getVersion() {
|
||||
return part.getVersionProperty().orElse(null);
|
||||
}
|
||||
|
||||
public String getRevision() {
|
||||
return part.getRevisionProperty().orElse(null);
|
||||
}
|
||||
|
|
|
@ -219,6 +219,9 @@ public final class TestPOIXMLProperties {
|
|||
assertEquals("Greetings", subject);
|
||||
String title = _coreProperties.getTitle();
|
||||
assertEquals("Hello World", title);
|
||||
assertNull(_coreProperties.getVersion());
|
||||
_coreProperties.setVersion("1.2.3");
|
||||
assertEquals("1.2.3", _coreProperties.getVersion());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue