public enum Protocol extends Enum<Protocol> implements org.refcodes.mixin.NameAccessor
Protocol
define values useful when working with files or a
file-system.Modifier and Type | Method and Description |
---|---|
int |
firstResourceLocatorIndex(String aUrl)
Returns the index of locator part pointing into the resource of the given
URL.
|
String |
getName() |
int |
nextResourceLocatorIndex(String aUrl,
int aBeginIndex)
Returns the index of the locator part pointing into the resource of the
given URL.
|
String |
toPrefix()
Returns the path prefix for the protocol being the protocol name and the
protocol suffix (":"), e.g.
|
String |
toResourceLocator(String aUrl)
Returns the locator part pointing into the resource of the given URL.
|
String |
toResourceLocator(String aUrl,
int aBeginIndex)
Returns the locator part pointing into the resource of the given URL.
|
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.
|
public static final Protocol JAR
public static final Protocol FILE
public static final Protocol HTTP
public static final Protocol HTTPS
public static Protocol[] values()
for (Protocol c : Protocol.values()) System.out.println(c);
public static Protocol valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
getName
in interface org.refcodes.mixin.NameAccessor
public String toPrefix()
public String toResourceLocator(String aUrl, int aBeginIndex)
aUrl
- The URL from which to retrieve the locator part.aBeginIndex
- The index from where to start.public String toResourceLocator(String aUrl)
aUrl
- The URL from which to retrieve the locator part.public int nextResourceLocatorIndex(String aUrl, int aBeginIndex)
aUrl
- The URL from which to retrieve the locator part.aBeginIndex
- The index from where to start.public int firstResourceLocatorIndex(String aUrl)
aUrl
- The URL from which to retrieve the locator part.Copyright © 2016. All rights reserved.