public interface PropertyMap
A property map can store string-keyed values of various primitive types, nested property maps, and uniformly typed (ordered) collections of values. Because it is immutable, it can be passed around between objects without worrying about thread safety. Null values cannot be stored.
To create a PropertyMap, use PropertyMaps.builder()
.
Property maps can be converted to a specific JSON format and back in a type-preserving manner.
Property maps are similar in concept to Properties
but
stores typed values rather than just strings, and supports storage of nested
property maps.
Methods to access primitive types
PropertyMap pm = ...
pm.containsLong("key"); // - true if "key" exists and type is long
pm.getLong("key", 0L); // - 0L if "key" is missing
// Throws ClassCastException if value is wrong type
pm.containsLongList("key2"); // - true if "key2" exists and type is
// collection of longs
pm.getLongList("key2") // - long[] {} if "key2" is missing
// Throws ClassCastException if value is wrong type
pm.getLongList("key2", 0L, 1L, 2L) // - long[] { 0, 1, 2 } if "key2" is missing
pm.getLongList("key2", new ArrayList <Long >());
// Return List <Long >, or
// the empty arraylist
pm.getLongList("key2", null); // - (List <Long >) null if "key2" missing
Note that, for the collections (plural) get methods, the returned value is
an array (long[]
if the default value was given as an array or varargs,
whereas it is a list (List<long>
) if the
default value was given as any collection or iterable.
The same pattern applies to boolean
, byte
, short
,
int
, long
, float
, and double
. (No char
or void
, this is intentional.)
Methods to access primitive types
pm.containsString("key3");
pm.getString("key3", "foo");
pm.containsStringList("key4");
// The following both return List <String >:
pm.getStringList("key4", "a", "b", "c"); // Default = List of "a", "b", "c"
pm.getStringList("key4", listOfStrings);
This differs from the case of primitive types in that the collection (plural)
get methods return a List
regardless of the type of the default value.
The same pattern applies to String
, Color
, AffineTransform
, Rectangle
, Dimension
, Point
, and
nested PropertyMap
.
Methods to access enum types
Enum values can be stored by automatically converting to String
.
See containsStringForEnum(java.lang.String, java.lang.Class<E>)
, containsStringListForEnumList(java.lang.String, java.lang.Class<E>)
,
getStringAsEnum(java.lang.String, java.lang.Class<E>, E)
, and getStringListAsEnumList(java.lang.String, java.lang.Class<E>, E...)
. This is useful for
storing multiple-choice settings
For how to insert values of the various types, see PropertyMap.Builder
.
Modifier and Type | Interface and Description |
---|---|
static interface |
PropertyMap.Builder
Builder for
PropertyMap . |
static interface |
PropertyMap.OpaqueValue
A value that can be stored in a property map.
|
static interface |
PropertyMap.PropertyMapBuilder
Deprecated.
|
static class |
PropertyMap.TypeMismatchException
Deprecated.
If necessary, catch ClassCastException instead.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAffineTransform(java.lang.String key) |
boolean |
containsAffineTransformList(java.lang.String key) |
boolean |
containsAll(java.util.Collection<?> keys) |
boolean |
containsBoolean(java.lang.String key) |
boolean |
containsBooleanList(java.lang.String key) |
boolean |
containsByte(java.lang.String key) |
boolean |
containsByteList(java.lang.String key) |
boolean |
containsColor(java.lang.String key) |
boolean |
containsColorList(java.lang.String key) |
boolean |
containsDimension(java.lang.String key) |
boolean |
containsDimensionList(java.lang.String key) |
boolean |
containsDouble(java.lang.String key) |
boolean |
containsDoubleList(java.lang.String key) |
boolean |
containsFloat(java.lang.String key) |
boolean |
containsFloatList(java.lang.String key) |
boolean |
containsInteger(java.lang.String key) |
boolean |
containsIntegerList(java.lang.String key) |
boolean |
containsKey(java.lang.String key) |
boolean |
containsLong(java.lang.String key) |
boolean |
containsLongList(java.lang.String key) |
boolean |
containsNumber(java.lang.String key) |
boolean |
containsNumberList(java.lang.String key) |
boolean |
containsPoint(java.lang.String key) |
boolean |
containsPointList(java.lang.String key) |
boolean |
containsPropertyMap(java.lang.String key) |
boolean |
containsPropertyMapList(java.lang.String key) |
boolean |
containsRectangle(java.lang.String key) |
boolean |
containsRectangleList(java.lang.String key) |
boolean |
containsShort(java.lang.String key) |
boolean |
containsShortList(java.lang.String key) |
boolean |
containsString(java.lang.String key) |
<E extends java.lang.Enum<E>> |
containsStringForEnum(java.lang.String key,
java.lang.Class<E> enumType) |
boolean |
containsStringList(java.lang.String key) |
<E extends java.lang.Enum<E>> |
containsStringListForEnumList(java.lang.String key,
java.lang.Class<E> enumType) |
boolean |
containsUUID(java.lang.String key) |
boolean |
containsUUIDList(java.lang.String key) |
PropertyMap.PropertyMapBuilder |
copy()
Deprecated.
|
PropertyMap.Builder |
copyBuilder() |
java.awt.geom.AffineTransform |
getAffineTransform(java.lang.String key,
java.awt.geom.AffineTransform aDefault) |
java.util.List<java.awt.geom.AffineTransform> |
getAffineTransformList(java.lang.String key,
java.awt.geom.AffineTransform... defaults) |
java.util.List<java.awt.geom.AffineTransform> |
getAffineTransformList(java.lang.String key,
java.lang.Iterable<java.awt.geom.AffineTransform> defaults) |
java.lang.Number |
getAsNumber(java.lang.String key,
java.lang.Number aDefault)
Retrieve a numerical value, without checking its specific type.
|
java.util.List<java.lang.Number> |
getAsNumberList(java.lang.String key,
java.lang.Iterable<java.lang.Number> defaults) |
java.util.List<java.lang.Number> |
getAsNumberList(java.lang.String key,
java.lang.Number... defaults) |
PropertyMap.OpaqueValue |
getAsOpaqueValue(java.lang.String key) |
java.lang.Boolean |
getBoolean(java.lang.String key)
Deprecated.
|
boolean |
getBoolean(java.lang.String key,
boolean aDefault) |
java.lang.Boolean |
getBoolean(java.lang.String key,
java.lang.Boolean aDefault)
Deprecated.
|
java.lang.Boolean[] |
getBooleanArray(java.lang.String key)
Deprecated.
|
java.lang.Boolean[] |
getBooleanArray(java.lang.String key,
java.lang.Boolean[] aDefault)
Deprecated.
|
boolean[] |
getBooleanList(java.lang.String key,
boolean... defaults) |
java.util.List<java.lang.Boolean> |
getBooleanList(java.lang.String key,
java.lang.Iterable<java.lang.Boolean> defaults) |
byte |
getByte(java.lang.String key,
byte aDefault) |
byte[] |
getByteList(java.lang.String key,
byte... defaults) |
java.util.List<java.lang.Byte> |
getByteList(java.lang.String key,
java.lang.Iterable<java.lang.Byte> defaults) |
java.awt.Color |
getColor(java.lang.String key,
java.awt.Color aDefault) |
java.util.List<java.awt.Color> |
getColorList(java.lang.String key,
java.awt.Color... defaults) |
java.util.List<java.awt.Color> |
getColorList(java.lang.String key,
java.lang.Iterable<java.awt.Color> defaults) |
java.awt.Dimension |
getDimension(java.lang.String key,
java.awt.Dimension aDefault) |
java.util.List<java.awt.Dimension> |
getDimensionList(java.lang.String key,
java.awt.Dimension... defaults) |
java.util.List<java.awt.Dimension> |
getDimensionList(java.lang.String key,
java.lang.Iterable<java.awt.Dimension> defaults) |
java.lang.Double |
getDouble(java.lang.String key)
Deprecated.
|
double |
getDouble(java.lang.String key,
double aDefault) |
java.lang.Double |
getDouble(java.lang.String key,
java.lang.Double aDefault)
Deprecated.
|
java.lang.Double[] |
getDoubleArray(java.lang.String key)
Deprecated.
|
java.lang.Double[] |
getDoubleArray(java.lang.String key,
java.lang.Double[] aDefault)
Deprecated.
|
double[] |
getDoubleList(java.lang.String key,
double... defaults) |
java.util.List<java.lang.Double> |
getDoubleList(java.lang.String key,
java.lang.Iterable<java.lang.Double> defaults) |
float |
getFloat(java.lang.String key,
float aDefault) |
float[] |
getFloatList(java.lang.String key,
float... defaults) |
java.util.List<java.lang.Float> |
getFloatList(java.lang.String key,
java.lang.Iterable<java.lang.Float> defaults) |
java.lang.Integer |
getInt(java.lang.String key)
Deprecated.
|
java.lang.Integer |
getInt(java.lang.String key,
java.lang.Integer aDefault)
Deprecated.
|
java.lang.Integer[] |
getIntArray(java.lang.String key)
Deprecated.
|
java.lang.Integer[] |
getIntArray(java.lang.String key,
java.lang.Integer[] aDefault)
Deprecated.
|
int |
getInteger(java.lang.String key,
int aDefault) |
int[] |
getIntegerList(java.lang.String key,
int... defaults) |
java.util.List<java.lang.Integer> |
getIntegerList(java.lang.String key,
java.lang.Iterable<java.lang.Integer> defaults) |
java.util.Set<java.lang.String> |
getKeys()
Deprecated.
|
java.lang.Long |
getLong(java.lang.String key)
Deprecated.
|
long |
getLong(java.lang.String key,
long aDefault) |
java.lang.Long |
getLong(java.lang.String key,
java.lang.Long aDefault)
Deprecated.
|
java.lang.Long[] |
getLongArray(java.lang.String key)
Deprecated.
|
java.lang.Long[] |
getLongArray(java.lang.String key,
java.lang.Long[] aDefault)
Deprecated.
|
java.util.List<java.lang.Long> |
getLongList(java.lang.String key,
java.lang.Iterable<java.lang.Long> defaults) |
long[] |
getLongList(java.lang.String key,
long... defaults) |
java.awt.Point |
getPoint(java.lang.String key,
java.awt.Point aDefault) |
java.util.List<java.awt.Point> |
getPointList(java.lang.String key,
java.lang.Iterable<java.awt.Point> defaults) |
java.util.List<java.awt.Point> |
getPointList(java.lang.String key,
java.awt.Point... defaults) |
PropertyMap |
getPropertyMap(java.lang.String key)
Deprecated.
|
PropertyMap |
getPropertyMap(java.lang.String key,
PropertyMap aDefault) |
java.util.List<PropertyMap> |
getPropertyMapList(java.lang.String key,
java.lang.Iterable<PropertyMap> defaults) |
java.util.List<PropertyMap> |
getPropertyMapList(java.lang.String key,
PropertyMap... defaults) |
java.lang.Class |
getPropertyType(java.lang.String key)
Deprecated.
|
java.awt.Rectangle |
getRectangle(java.lang.String key,
java.awt.Rectangle aDefault) |
java.util.List<java.awt.Rectangle> |
getRectangleList(java.lang.String key,
java.lang.Iterable<java.awt.Rectangle> defaults) |
java.util.List<java.awt.Rectangle> |
getRectangleList(java.lang.String key,
java.awt.Rectangle... defaults) |
short |
getShort(java.lang.String key,
short aDefault) |
java.util.List<java.lang.Short> |
getShortList(java.lang.String key,
java.lang.Iterable<java.lang.Short> defaults) |
short[] |
getShortList(java.lang.String key,
short... defaults) |
java.lang.String |
getString(java.lang.String key)
Deprecated.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String aDefault) |
java.lang.String[] |
getStringArray(java.lang.String key)
Deprecated.
|
java.lang.String[] |
getStringArray(java.lang.String key,
java.lang.String[] aDefault)
Deprecated.
|
<E extends java.lang.Enum<E>> |
getStringAsEnum(java.lang.String key,
java.lang.Class<E> enumType,
E aDefault)
Get a string value, converted to an enum value.
|
java.util.List<java.lang.String> |
getStringList(java.lang.String key,
java.lang.Iterable<java.lang.String> defaults) |
java.util.List<java.lang.String> |
getStringList(java.lang.String key,
java.lang.String... defaults) |
<E extends java.lang.Enum<E>> |
getStringListAsEnumList(java.lang.String key,
java.lang.Class<E> enumType,
E... defaults) |
<E extends java.lang.Enum<E>> |
getStringListAsEnumList(java.lang.String key,
java.lang.Class<E> enumType,
java.lang.Iterable<E> defaults)
Get a collection of strings, converted to a collection of enum values.
|
java.util.UUID |
getUUID(java.lang.String key,
java.util.UUID aDefault) |
java.util.List<java.util.UUID> |
getUUIDList(java.lang.String key,
java.lang.Iterable<java.util.UUID> defaults) |
java.util.List<java.util.UUID> |
getUUIDList(java.lang.String key,
java.util.UUID... defaults) |
java.lang.String |
getValueAsString(java.lang.String key,
java.lang.String aDefault) |
java.lang.Class<?> |
getValueTypeForKey(java.lang.String key)
Return a class indicating the type of the value for the given key.
|
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet()
Return an unmodifiable set containing all of the keys.
|
PropertyMap |
merge(PropertyMap alt)
Deprecated.
|
void |
save(java.lang.String path)
Deprecated.
|
boolean |
saveJSON(java.io.File file,
boolean overwrite,
boolean createBackup)
Save to a file as JSON.
|
int |
size() |
java.lang.String |
toJSON()
Create a JSON representation of this property map.
|
PropertyMap.Builder copyBuilder()
java.util.Set<java.lang.String> keySet()
boolean containsKey(java.lang.String key)
boolean containsAll(java.util.Collection<?> keys)
boolean isEmpty()
int size()
java.lang.Class<?> getValueTypeForKey(java.lang.String key)
This method is intended for special code that handles serialization or conversion of property maps. In most cases, code that uses PropertyMap as a container for settings or data should use a fixed, pre-determined type for each key.
For object (non-primitive) types, the class is returned (e.g. String.class
, PropertyMap.class
).
For primitive types, the primitive type class is returned (e.g. int.class
, float.class
). Note that int.class !=
Integer.class
.
For collection (plural) types, the corresponding array type is returned
(e.g. int[].class
, String[].class
).
Keys stored as "EnumAsString" return String.class
.
key
- java.lang.IllegalArgumentException
- if key
is not foundPropertyMap.OpaqueValue getAsOpaqueValue(java.lang.String key)
java.lang.String getValueAsString(java.lang.String key, java.lang.String aDefault)
boolean containsBoolean(java.lang.String key)
boolean getBoolean(java.lang.String key, boolean aDefault)
boolean containsBooleanList(java.lang.String key)
boolean[] getBooleanList(java.lang.String key, boolean... defaults)
java.util.List<java.lang.Boolean> getBooleanList(java.lang.String key, java.lang.Iterable<java.lang.Boolean> defaults)
boolean containsByte(java.lang.String key)
byte getByte(java.lang.String key, byte aDefault)
boolean containsByteList(java.lang.String key)
byte[] getByteList(java.lang.String key, byte... defaults)
java.util.List<java.lang.Byte> getByteList(java.lang.String key, java.lang.Iterable<java.lang.Byte> defaults)
boolean containsShort(java.lang.String key)
short getShort(java.lang.String key, short aDefault)
boolean containsShortList(java.lang.String key)
short[] getShortList(java.lang.String key, short... defaults)
java.util.List<java.lang.Short> getShortList(java.lang.String key, java.lang.Iterable<java.lang.Short> defaults)
boolean containsInteger(java.lang.String key)
int getInteger(java.lang.String key, int aDefault)
boolean containsIntegerList(java.lang.String key)
int[] getIntegerList(java.lang.String key, int... defaults)
java.util.List<java.lang.Integer> getIntegerList(java.lang.String key, java.lang.Iterable<java.lang.Integer> defaults)
boolean containsLong(java.lang.String key)
long getLong(java.lang.String key, long aDefault)
boolean containsLongList(java.lang.String key)
long[] getLongList(java.lang.String key, long... defaults)
java.util.List<java.lang.Long> getLongList(java.lang.String key, java.lang.Iterable<java.lang.Long> defaults)
boolean containsFloat(java.lang.String key)
float getFloat(java.lang.String key, float aDefault)
boolean containsFloatList(java.lang.String key)
float[] getFloatList(java.lang.String key, float... defaults)
java.util.List<java.lang.Float> getFloatList(java.lang.String key, java.lang.Iterable<java.lang.Float> defaults)
boolean containsDouble(java.lang.String key)
double getDouble(java.lang.String key, double aDefault)
boolean containsDoubleList(java.lang.String key)
double[] getDoubleList(java.lang.String key, double... defaults)
java.util.List<java.lang.Double> getDoubleList(java.lang.String key, java.lang.Iterable<java.lang.Double> defaults)
boolean containsNumber(java.lang.String key)
java.lang.Number getAsNumber(java.lang.String key, java.lang.Number aDefault)
This method may be useful for providing backward compatibility (for
example, if a value currently stored as a long
used to be stored
as an int
). It should not be used when the type-specific get
method can be used.
Code that calls this method should be prepared to handle any of the
following types correctly: Byte, Short, Integer, Long, Float,
Double
.
key
- aDefault
- boolean containsNumberList(java.lang.String key)
java.util.List<java.lang.Number> getAsNumberList(java.lang.String key, java.lang.Number... defaults)
java.util.List<java.lang.Number> getAsNumberList(java.lang.String key, java.lang.Iterable<java.lang.Number> defaults)
boolean containsString(java.lang.String key)
java.lang.String getString(java.lang.String key, java.lang.String aDefault)
boolean containsStringList(java.lang.String key)
java.util.List<java.lang.String> getStringList(java.lang.String key, java.lang.String... defaults)
java.util.List<java.lang.String> getStringList(java.lang.String key, java.lang.Iterable<java.lang.String> defaults)
boolean containsUUID(java.lang.String key)
java.util.UUID getUUID(java.lang.String key, java.util.UUID aDefault)
boolean containsUUIDList(java.lang.String key)
java.util.List<java.util.UUID> getUUIDList(java.lang.String key, java.util.UUID... defaults)
java.util.List<java.util.UUID> getUUIDList(java.lang.String key, java.lang.Iterable<java.util.UUID> defaults)
boolean containsColor(java.lang.String key)
java.awt.Color getColor(java.lang.String key, java.awt.Color aDefault)
boolean containsColorList(java.lang.String key)
java.util.List<java.awt.Color> getColorList(java.lang.String key, java.awt.Color... defaults)
java.util.List<java.awt.Color> getColorList(java.lang.String key, java.lang.Iterable<java.awt.Color> defaults)
boolean containsAffineTransform(java.lang.String key)
java.awt.geom.AffineTransform getAffineTransform(java.lang.String key, java.awt.geom.AffineTransform aDefault)
boolean containsAffineTransformList(java.lang.String key)
java.util.List<java.awt.geom.AffineTransform> getAffineTransformList(java.lang.String key, java.awt.geom.AffineTransform... defaults)
java.util.List<java.awt.geom.AffineTransform> getAffineTransformList(java.lang.String key, java.lang.Iterable<java.awt.geom.AffineTransform> defaults)
boolean containsPropertyMap(java.lang.String key)
PropertyMap getPropertyMap(java.lang.String key, PropertyMap aDefault)
boolean containsPropertyMapList(java.lang.String key)
java.util.List<PropertyMap> getPropertyMapList(java.lang.String key, PropertyMap... defaults)
java.util.List<PropertyMap> getPropertyMapList(java.lang.String key, java.lang.Iterable<PropertyMap> defaults)
boolean containsRectangle(java.lang.String key)
java.awt.Rectangle getRectangle(java.lang.String key, java.awt.Rectangle aDefault)
boolean containsRectangleList(java.lang.String key)
java.util.List<java.awt.Rectangle> getRectangleList(java.lang.String key, java.awt.Rectangle... defaults)
java.util.List<java.awt.Rectangle> getRectangleList(java.lang.String key, java.lang.Iterable<java.awt.Rectangle> defaults)
boolean containsDimension(java.lang.String key)
java.awt.Dimension getDimension(java.lang.String key, java.awt.Dimension aDefault)
boolean containsDimensionList(java.lang.String key)
java.util.List<java.awt.Dimension> getDimensionList(java.lang.String key, java.awt.Dimension... defaults)
java.util.List<java.awt.Dimension> getDimensionList(java.lang.String key, java.lang.Iterable<java.awt.Dimension> defaults)
boolean containsPoint(java.lang.String key)
java.awt.Point getPoint(java.lang.String key, java.awt.Point aDefault)
boolean containsPointList(java.lang.String key)
java.util.List<java.awt.Point> getPointList(java.lang.String key, java.awt.Point... defaults)
java.util.List<java.awt.Point> getPointList(java.lang.String key, java.lang.Iterable<java.awt.Point> defaults)
<E extends java.lang.Enum<E>> boolean containsStringForEnum(java.lang.String key, java.lang.Class<E> enumType)
<E extends java.lang.Enum<E>> E getStringAsEnum(java.lang.String key, java.lang.Class<E> enumType, E aDefault)
The property map does not record the specific class of enum values. It is the caller's responsibility to specify the correct enum class.
If the value stored in the property map is not one of the allowed values
for enumType
, aDefault
will be returned.
E
- the enum classkey
- the property keyenumType
- the enum classaDefault
- a default value to return if the key is missing or
the stored value is an enum but not a known value for the given enum
class.key
<E extends java.lang.Enum<E>> boolean containsStringListForEnumList(java.lang.String key, java.lang.Class<E> enumType)
<E extends java.lang.Enum<E>> java.util.List<E> getStringListAsEnumList(java.lang.String key, java.lang.Class<E> enumType, E... defaults)
<E extends java.lang.Enum<E>> java.util.List<E> getStringListAsEnumList(java.lang.String key, java.lang.Class<E> enumType, java.lang.Iterable<E> defaults)
The property map does not record the specific class of enum values. It is the caller's responsibility to specify the correct enum class.
Unless all of the values stored in the property map are allowed values of
enumType
, defaults
will be returned.
E
- the enum classkey
- the property keyenumType
- the enum classdefaults
- a default collectionkey
java.lang.String toJSON()
To create a property map back from the JSON representation, see PropertyMaps.fromJSON(java.lang.String)
.
boolean saveJSON(java.io.File file, boolean overwrite, boolean createBackup) throws java.io.IOException
To create a property map back from the saved file, see PropertyMaps.loadJSON(java.io.File)
.
file
- the file to write tooverwrite
- if false and file exists, don't write and return falsecreateBackup
- if true and overwriting, first rename the existing
file by appending "~" to its namejava.io.IOException
- if there was an error writing to the file@Deprecated PropertyMap.PropertyMapBuilder copy()
@Deprecated java.lang.String getString(java.lang.String key)
@Deprecated java.lang.String[] getStringArray(java.lang.String key)
@Deprecated java.lang.String[] getStringArray(java.lang.String key, java.lang.String[] aDefault)
@Deprecated java.lang.Integer getInt(java.lang.String key)
@Deprecated java.lang.Integer getInt(java.lang.String key, java.lang.Integer aDefault)
@Deprecated java.lang.Integer[] getIntArray(java.lang.String key)
@Deprecated java.lang.Integer[] getIntArray(java.lang.String key, java.lang.Integer[] aDefault)
@Deprecated java.lang.Long getLong(java.lang.String key)
@Deprecated java.lang.Long getLong(java.lang.String key, java.lang.Long aDefault)
@Deprecated java.lang.Long[] getLongArray(java.lang.String key)
@Deprecated java.lang.Long[] getLongArray(java.lang.String key, java.lang.Long[] aDefault)
@Deprecated java.lang.Double getDouble(java.lang.String key)
@Deprecated java.lang.Double getDouble(java.lang.String key, java.lang.Double aDefault)
@Deprecated java.lang.Double[] getDoubleArray(java.lang.String key)
@Deprecated java.lang.Double[] getDoubleArray(java.lang.String key, java.lang.Double[] aDefault)
@Deprecated java.lang.Boolean getBoolean(java.lang.String key)
@Deprecated java.lang.Boolean getBoolean(java.lang.String key, java.lang.Boolean aDefault)
@Deprecated java.lang.Boolean[] getBooleanArray(java.lang.String key)
@Deprecated java.lang.Boolean[] getBooleanArray(java.lang.String key, java.lang.Boolean[] aDefault)
@Deprecated PropertyMap getPropertyMap(java.lang.String key)
@Deprecated PropertyMap merge(PropertyMap alt)
@Deprecated java.util.Set<java.lang.String> getKeys()
@Deprecated java.lang.Class getPropertyType(java.lang.String key)
@Deprecated void save(java.lang.String path) throws java.io.IOException
java.io.IOException