Package it.geosolutions.geoserver.rest
Enum GeoServerRESTPublisher.Format
- java.lang.Object
-
- java.lang.Enum<GeoServerRESTPublisher.Format>
-
- it.geosolutions.geoserver.rest.GeoServerRESTPublisher.Format
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<GeoServerRESTPublisher.Format>
- Enclosing class:
- GeoServerRESTPublisher
public static enum GeoServerRESTPublisher.Format extends java.lang.Enum<GeoServerRESTPublisher.Format>
Represents the format used to GET, PUT or POST information via REST. For example consider the resource "foo". To request a representation of foo as XML the request uri would end with "foo.xml". To request as JSON the request uri would end with "foo.json". When no format is specified the server will use its own internal format, usually html.In a POST or PUT operation the format specifies 1) the representatin of the content being sent to the server, and 2) the representation of the response to be sent back. The former is specified with the Content-type header. To send a representation in XML, the content type "text/xml" or "application/xml" would be used. The latter is specified with the Accepts header as specified in the above paragraph describing a GET operation.
The following table defines the Content-type values for each format:
- XML (application/xml)
- JSON (application/json)
- HTML (application/html)
- SLD (application/vnd.ogc.sld+xml)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()Gets the mime type from a format.static java.lang.StringgetContentType(GeoServerRESTPublisher.Format f)Gets the mime type from a format.java.lang.StringtoString()Returns a lowercase representation of the parameter.static GeoServerRESTPublisher.FormatvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static GeoServerRESTPublisher.Format[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
XML
public static final GeoServerRESTPublisher.Format XML
-
JSON
public static final GeoServerRESTPublisher.Format JSON
-
HTML
public static final GeoServerRESTPublisher.Format HTML
-
SLD
public static final GeoServerRESTPublisher.Format SLD
-
SLD_1_1_0
public static final GeoServerRESTPublisher.Format SLD_1_1_0
-
ZIP
public static final GeoServerRESTPublisher.Format ZIP
-
-
Method Detail
-
values
public static GeoServerRESTPublisher.Format[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GeoServerRESTPublisher.Format c : GeoServerRESTPublisher.Format.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GeoServerRESTPublisher.Format valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getContentType
public static java.lang.String getContentType(GeoServerRESTPublisher.Format f)
Gets the mime type from a format.- Parameters:
f- the format key.- Returns:
- The content-type (mime), or
nullif not in the enum.
-
getContentType
public java.lang.String getContentType()
Gets the mime type from a format.- Returns:
- The content-type (mime), or
nullif not in the enum.
-
toString
public java.lang.String toString()
Returns a lowercase representation of the parameter. Useful when constructing the REST request.- Overrides:
toStringin classjava.lang.Enum<GeoServerRESTPublisher.Format>
-
-