Commit 255dd581 authored by Guus der Kinderen's avatar Guus der Kinderen Committed by daryl herzmann

OF-1490: Update HTTP File Upload Plugin dependencies to 1.1.3. (#1024)

parent 3c470c80
...@@ -41,6 +41,18 @@ ...@@ -41,6 +41,18 @@
<h1>HTTP File Upload Plugin Changelog</h1> <h1>HTTP File Upload Plugin Changelog</h1>
<p><b>1.1.0</b> -- February 19, 2018</p>
<ul>
<li>Updated to HttpFileUploadComponent v1.1.3, which resolves:</li>
<ul>
<li><a href="https://github.com/guusdk/httpfileuploadcomponent/issues/5">Issue #5:</a> Maximum allowable file size should be configurable.</li>
<li><a href="https://github.com/guusdk/httpfileuploadcomponent/issues/6">Issue #6:</a> Fix for NPE when client uses XEP v0.3 or higher.</li>
<li><a href="https://github.com/guusdk/httpfileuploadcomponent/issues/7">Issue #7:</a> Responses to slot requests should use syntax of the request.</li>
<li><a href="https://github.com/guusdk/httpfileuploadcomponent/issues/8">Issue #8:</a> Add maximum file size to service discovery responses.</li>
</ul>
</ul>
<p><b>1.0.0</b> -- December 14, 2017</p> <p><b>1.0.0</b> -- December 14, 2017</p>
<ul> <ul>
<li>Initial release.</li> <li>Initial release.</li>
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<name>HTTP File Upload</name> <name>HTTP File Upload</name>
<description>Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.</description> <description>Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.</description>
<author>Guus der Kinderen</author> <author>Guus der Kinderen</author>
<version>1.0.0</version> <version>1.1.0</version>
<date>12/14/2017</date> <date>19/02/2018</date>
</plugin> </plugin>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<artifactId>httpfileupload</artifactId> <artifactId>httpfileupload</artifactId>
<name>HTTP File Upload Plugin</name> <name>HTTP File Upload Plugin</name>
<description>Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.</description> <description>Allows clients to share files, as described in the XEP-0363 'HTTP File Upload' specification.</description>
<version>1.0.0</version> <version>1.1.0</version>
<build> <build>
<sourceDirectory>src/java</sourceDirectory> <sourceDirectory>src/java</sourceDirectory>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>nl.goodbytes.xmpp.xep</groupId> <groupId>nl.goodbytes.xmpp.xep</groupId>
<artifactId>httpfileuploadcomponent</artifactId> <artifactId>httpfileuploadcomponent</artifactId>
<version>1.1.2</version> <version>1.1.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -71,6 +71,14 @@ ...@@ -71,6 +71,14 @@
automatically deployed. To upgrade to a new version, copy the new httpfileupload.jar file over the existing file. automatically deployed. To upgrade to a new version, copy the new httpfileupload.jar file over the existing file.
</p> </p>
<h2>Configuration</h2>
<p>
To configure the maximum allowable file size to be uploaded by clients, the property
<tt>plugin.httpfileupload.maxFileSize</tt> can be set to a value in bytes. If not set, a default value is used. To
disable the file size limitation, set this property to a value of <tt>-1</tt>.
</p>
<h2>Using the Plugin</h2> <h2>Using the Plugin</h2>
<p> <p>
......
package org.igniterealtime.openfire.plugins.httpfileupload; package org.igniterealtime.openfire.plugins.httpfileupload;
import nl.goodbytes.xmpp.xep0363.Component; import nl.goodbytes.xmpp.xep0363.Component;
import nl.goodbytes.xmpp.xep0363.Slot;
import nl.goodbytes.xmpp.xep0363.SlotManager;
import org.apache.tomcat.InstanceManager; import org.apache.tomcat.InstanceManager;
import org.apache.tomcat.SimpleInstanceManager; import org.apache.tomcat.SimpleInstanceManager;
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer; import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
...@@ -12,6 +14,9 @@ import org.jivesoftware.openfire.component.InternalComponentManager; ...@@ -12,6 +14,9 @@ import org.jivesoftware.openfire.component.InternalComponentManager;
import org.jivesoftware.openfire.container.Plugin; import org.jivesoftware.openfire.container.Plugin;
import org.jivesoftware.openfire.container.PluginManager; import org.jivesoftware.openfire.container.PluginManager;
import org.jivesoftware.openfire.http.HttpBindManager; import org.jivesoftware.openfire.http.HttpBindManager;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xmpp.component.ComponentException; import org.xmpp.component.ComponentException;
...@@ -21,13 +26,15 @@ import java.net.MalformedURLException; ...@@ -21,13 +26,15 @@ import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by guus on 18-11-17. * Created by guus on 18-11-17.
*/ */
public class HttpFileUploadPlugin implements Plugin public class HttpFileUploadPlugin implements Plugin, PropertyEventListener
{ {
private static final Logger Log = LoggerFactory.getLogger( HttpFileUploadPlugin.class ); private static final Logger Log = LoggerFactory.getLogger( HttpFileUploadPlugin.class );
private Component component; private Component component;
private WebAppContext context; private WebAppContext context;
...@@ -42,6 +49,9 @@ public class HttpFileUploadPlugin implements Plugin ...@@ -42,6 +49,9 @@ public class HttpFileUploadPlugin implements Plugin
{ {
try try
{ {
SlotManager.getInstance().setMaxFileSize( JiveGlobals.getLongProperty( "plugin.httpfileupload.maxFileSize", SlotManager.DEFAULT_MAX_FILE_SIZE ) );
PropertyEventDispatcher.addListener( this );
final URL endpoint = new URL( "https", XMPPServer.getInstance().getServerInfo().getHostname(), HttpBindManager.getInstance().getHttpBindSecurePort(), "/httpfileupload"); final URL endpoint = new URL( "https", XMPPServer.getInstance().getServerInfo().getHostname(), HttpBindManager.getInstance().getHttpBindSecurePort(), "/httpfileupload");
component = new Component( XMPPServer.getInstance().getServerInfo().getXMPPDomain(), endpoint ); component = new Component( XMPPServer.getInstance().getServerInfo().getXMPPDomain(), endpoint );
...@@ -78,6 +88,8 @@ public class HttpFileUploadPlugin implements Plugin ...@@ -78,6 +88,8 @@ public class HttpFileUploadPlugin implements Plugin
@Override @Override
public void destroyPlugin() public void destroyPlugin()
{ {
PropertyEventDispatcher.removeListener( this );
for ( final String publicResource : publicResources ) for ( final String publicResource : publicResources )
{ {
AuthCheckFilter.removeExclude( publicResource ); AuthCheckFilter.removeExclude( publicResource );
...@@ -95,4 +107,40 @@ public class HttpFileUploadPlugin implements Plugin ...@@ -95,4 +107,40 @@ public class HttpFileUploadPlugin implements Plugin
InternalComponentManager.getInstance().removeComponent( "httpfileupload" ); InternalComponentManager.getInstance().removeComponent( "httpfileupload" );
} }
} }
@Override
public void propertySet( String property, Map params )
{
if ( "plugin.httpfileupload.maxFileSize".equals( property ) )
{
SlotManager.getInstance().setMaxFileSize( JiveGlobals.getLongProperty( "plugin.httpfileupload.maxFileSize", SlotManager.DEFAULT_MAX_FILE_SIZE ) );
}
}
@Override
public void propertyDeleted( String property, Map params )
{
if ( "plugin.httpfileupload.maxFileSize".equals( property ) )
{
SlotManager.getInstance().setMaxFileSize( JiveGlobals.getLongProperty( "plugin.httpfileupload.maxFileSize", SlotManager.DEFAULT_MAX_FILE_SIZE ) );
}
}
@Override
public void xmlPropertySet( String property, Map params )
{
if ( "plugin.httpfileupload.maxFileSize".equals( property ) )
{
SlotManager.getInstance().setMaxFileSize( JiveGlobals.getLongProperty( "plugin.httpfileupload.maxFileSize", SlotManager.DEFAULT_MAX_FILE_SIZE ) );
}
}
@Override
public void xmlPropertyDeleted( String property, Map params )
{
if ( "plugin.httpfileupload.maxFileSize".equals( property ) )
{
SlotManager.getInstance().setMaxFileSize( JiveGlobals.getLongProperty( "plugin.httpfileupload.maxFileSize", SlotManager.DEFAULT_MAX_FILE_SIZE ) );
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment