de.agilecoders.wicket.webjars.settings
Enum ResourceStreamProvider

java.lang.Object
  extended by java.lang.Enum<ResourceStreamProvider>
      extended by de.agilecoders.wicket.webjars.settings.ResourceStreamProvider
All Implemented Interfaces:
Serializable, Comparable<ResourceStreamProvider>

public enum ResourceStreamProvider
extends Enum<ResourceStreamProvider>

A ResourceStreamProvider is responsible for creating resource streams. There are several implementations that

Author:
miha

Enum Constant Summary
ClassLoader
          The ClassLoader provider uses ClassLoader.getResourceAsStream(String) with a custom AbstractResourceStream implementation.
Url
          The Url provider uses a UrlResourceStream to load a resource.
 
Method Summary
static ResourceStreamProvider bestFitting()
           
abstract  IResourceStreamProvider newInstance(ClassLoader... classLoaders)
          creates a new IResourceStreamProvider instance according to this instance.
static ResourceStreamProvider valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ResourceStreamProvider[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ClassLoader

public static final ResourceStreamProvider ClassLoader
The ClassLoader provider uses ClassLoader.getResourceAsStream(String) with a custom AbstractResourceStream implementation.


Url

public static final ResourceStreamProvider Url
The Url provider uses a UrlResourceStream to load a resource. This provider can't be used on GAE, because it uses URL.openConnection().

Method Detail

values

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

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

valueOf

public static ResourceStreamProvider 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

newInstance

public abstract IResourceStreamProvider newInstance(ClassLoader... classLoaders)
creates a new IResourceStreamProvider instance according to this instance.

Parameters:
classLoaders - the class loaders to use to load/find resources
Returns:
new IResourceStreamProvider instance

bestFitting

public static ResourceStreamProvider bestFitting()
Returns:
best fitting ResourceStreamProvider


Copyright © 2016 agilecoders.de. All Rights Reserved.