com.silverpeas.gallery.constant
Enum StreamingProvider

java.lang.Object
  extended by java.lang.Enum<StreamingProvider>
      extended by com.silverpeas.gallery.constant.StreamingProvider
All Implemented Interfaces:
Serializable, Comparable<StreamingProvider>

public enum StreamingProvider
extends Enum<StreamingProvider>


Enum Constant Summary
dailymotion
           
soundcloud
           
unknown
           
vimeo
           
youtube
           
 
Field Summary
static Set<StreamingProvider> ALL_VALIDS
           
 
Method Summary
 String extractStreamingId(String url)
          Gets the identifier of the stream from an url.
static StreamingProvider from(String provider)
          Retrieves from the specified string the streaming provider.
static StreamingProvider fromUrl(String streamingUrl)
          Retrieves from the specified string the streaming provider.
 String getName()
           
static String getOembedUrl(String homepageUrl)
          Gets the oembed url from the homepage url of a streaming.
 List<String> getRegexpDetectionParts()
          Gets the regexp detection parts
 boolean isUnknown()
          Indicates if the provider is an unknown one.
static StreamingProvider valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StreamingProvider[] 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

unknown

public static final StreamingProvider unknown

youtube

public static final StreamingProvider youtube

vimeo

public static final StreamingProvider vimeo

dailymotion

public static final StreamingProvider dailymotion

soundcloud

public static final StreamingProvider soundcloud
Field Detail

ALL_VALIDS

public static final Set<StreamingProvider> ALL_VALIDS
Method Detail

values

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

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

valueOf

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

from

public static StreamingProvider from(String provider)
Retrieves from the specified string the streaming provider.

Parameters:
provider - the exact string of the provider (it is not case sensitive)
Returns:
the streaming provider found if any, unknown otherwise.

fromUrl

public static StreamingProvider fromUrl(String streamingUrl)
Retrieves from the specified string the streaming provider.

Parameters:
streamingUrl - the exact string of the provider (it is not case sensitive)
Returns:
the streaming provider found if any, unknown otherwise.

getOembedUrl

public static String getOembedUrl(String homepageUrl)
Gets the oembed url from the homepage url of a streaming.

Parameters:
homepageUrl - the streaming home page url.
Returns:
the oembed url as string.

getName

public String getName()

getRegexpDetectionParts

public List<String> getRegexpDetectionParts()
Gets the regexp detection parts

Returns:

isUnknown

public boolean isUnknown()
Indicates if the provider is an unknown one.

Returns:
true if unknown, false otherwise.

extractStreamingId

public String extractStreamingId(String url)
Gets the identifier of the stream from an url.

Parameters:
url -
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.