Java Code Examples for org.jivesoftware.util.JiveGlobals#getListProperty()

The following examples show how to use org.jivesoftware.util.JiveGlobals#getListProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PropertyBasedUserProviderMapper.java    From Openfire with Apache License 2.0 6 votes vote down vote up
@Override
public UserProvider getUserProvider( String username )
{
    for ( final Map.Entry<String, UserProvider> entry : providersByPrefix.entrySet() )
    {
        final String usersProperty = JiveGlobals.getProperty( entry.getKey() + ".members.propertyName" );
        if ( usersProperty != null )
        {
            final List<String> usersInSet = JiveGlobals.getListProperty( usersProperty, Collections.<String>emptyList() );
            if ( usersInSet.contains( username ) )
            {
                return entry.getValue();
            }
        }
    }

    return fallbackProvider;
}
 
Example 2
Source File: PropertyBasedAuthProviderMapper.java    From Openfire with Apache License 2.0 6 votes vote down vote up
@Override
public AuthProvider getAuthProvider( String username )
{
    for ( final Map.Entry<String, AuthProvider> entry : providersByPrefix.entrySet() )
    {
        final String usersProperty = JiveGlobals.getProperty( entry.getKey() + ".members.propertyName" );
        if ( usersProperty != null )
        {
            final List<String> usersInSet = JiveGlobals.getListProperty( usersProperty, Collections.<String>emptyList() );
            if ( usersInSet.contains( username ) )
            {
                return entry.getValue();
            }
        }
    }

    return fallbackProvider;
}
 
Example 3
Source File: PluginManager.java    From Openfire with Apache License 2.0 6 votes vote down vote up
/**
 * Verifies that the first few bytes of the input stream correspond to any of the known 'magic numbers' that
 * are known to represent a JAR archive.
 *
 * This method uses the mark/reset functionality of InputStream. This ensures that the input stream is reset
 * back to its original position after execution of this method.
 *
 * @param bin The input to read (cannot be null).
 * @return true if the stream first few bytes are equal to any of the known magic number sequences, otherwise false.
 */
public static boolean validMagicNumbers( final BufferedInputStream bin ) throws IOException
{
    final List<String> validMagicBytesCollection = JiveGlobals.getListProperty( "plugins.upload.magic-number.values.expected-value", Arrays.asList( "504B0304", "504B0506", "504B0708" ) );
    for ( final String entry : validMagicBytesCollection )
    {
        final byte[] validMagicBytes = StringUtils.decodeHex( entry );
        bin.mark( validMagicBytes.length );
        try
        {
            final byte[] magicBytes = new byte[validMagicBytes.length];
            final int bytesRead = IOUtils.read( bin, magicBytes );
            if ( bytesRead == validMagicBytes.length && Arrays.equals( validMagicBytes, magicBytes ) )
            {
                return true;
            }
        }
        finally
        {
            bin.reset();
        }
    }

    return false;
}
 
Example 4
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public List<String> getButtonsImplemented()
{
    // These should match the implementations that are provided in the Toolbox.web.js file in jitsi-meet.
    return JiveGlobals.getListProperty( "ofmeet.buttons.implemented", Arrays.asList( "camera", "chat", "desktop", "etherpad", "feedback", "fodeviceselection", "fullscreen", "hangup", "info", "invite", "microphone", "profile", "raisehand", "settings", "sharedvideo", "shortcuts", "stats", "videoquality" ) );
}
 
Example 5
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public List<String> getButtonsEnabled()
{
    return JiveGlobals.getListProperty( "ofmeet.buttons.enabled", Arrays.asList( "camera", "chat", "desktop", "etherpad", "feedback", "fodeviceselection", "fullscreen", "hangup", "info", "invite", "microphone", "profile", "raisehand", "settings", "sharedvideo", "shortcuts", "stats", "videoquality" ) );
}
 
Example 6
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public List<String> getStunMappingHarversterAddresses()
{
    return JiveGlobals.getListProperty( "org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES", Collections.<String>emptyList() );
}
 
Example 7
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public List<String> getInviteOptions()
{
    return JiveGlobals.getListProperty( "org.jitsi.videobridge.ofmeet.inviteOptions", Arrays.asList( "invite"  ) ); // "invite", "dialout", "addtocall"
}