org.geotoolkit.image.io
Enum Protocol

Object
  extended by Enum<Protocol>
      extended by Protocol
All Implemented Interfaces:
Serializable, Comparable<Protocol>

public enum Protocol
extends Enum<Protocol>

The protocol used for connecting to an image source through the network. Some protocols are specific to some plugins, for example the DODS protocol which is used only by NetcdfImageReader. Consequently, an inspection of the protocol can determine the image plugin to use.

This class provide also a convenient place where to summarize the various protocols understood by the Geotk library.

Since:
3.08
Version:
3.08
Author:
Martin Desruisseaux (Geomatys)
Module:
coverage/geotk-coverageio (download)    View source code for this class

Enum Constant Summary
DODS
          The Distributed Oceanographic Data System protocol.
FILE
          The File Protocol.
FTP
          The File Transfer Protocol.
HTTP
          The Hyper Text Transfer Protocol.
UNKNOWN
          Any protocol not in the above list.
 
Method Summary
static Protocol getProtocol(Object input)
          Returns the protocol of the given input, or UNKNOWN.
static Protocol valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Protocol[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FILE

public static final Protocol FILE
The File Protocol. This is understood by every plugins defined in the Geotk library.


FTP

public static final Protocol FTP
The File Transfer Protocol. This is understood by every plugins defined in the Geotk library, but the FileImageReader will need to copy its content to a temporary file.


HTTP

public static final Protocol HTTP
The Hyper Text Transfer Protocol. This is understood by every plugins defined in the Geotk library, but the FileImageReader will need to copy its content to a temporary file.


DODS

public static final Protocol DODS
The Distributed Oceanographic Data System protocol. This is specific to the NetcdfImageReader plugin.


UNKNOWN

public static final Protocol UNKNOWN
Any protocol not in the above list.

Method Detail

values

public static Protocol[] 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 (Protocol c : Protocol.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Protocol valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getProtocol

public static Protocol getProtocol(Object input)
Returns the protocol of the given input, or UNKNOWN. The input shall be an instance of File, URL, URI or CharSequence. Any other type will cause UNKNOWN to be returned.

Parameters:
input - The image input.
Returns:
The protocol used by the given input, or UNKNOWN.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.