Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Share files in a buddycloud channel

branch: master


A media server for buddycloud channels. It provides a simple REST-like HTTP interface where clients can do several operations like:

  • upload: upload media to private/public channels, the permissions are based on channels pubsub subscriptions;
  • download: download/visualize media from channels that you have enough permissions;
  • delete: you can delete medias that you've uploaded or if you are a channel moderator/owner;
  • update: update media metadata, with similar permissions as the delete operation.

To authenticate HTTP requests, the media server uses XEP-0070, this means that the client must have an XMPP client that "understands" such protocol in order to do media requests. There is only one exception: download media from public channels - any client has access.


The API is described in detail here.


The server is written on top of Java using RESTlet.

It uses Maven to build its packages. You can build the package manually or download it from here.

After unpacking, you can then start it by invoking

bash mediaserver

The server needs to be configured to point to a Buddycloud and XMPP server. See the Configuration section.


You can configure the media server by copying to in the server's root directory, and then editing as required. This file has multiple properties definitions:




# How much time it will wait for a response to an XMPP request (in milliseconds)


# Max threshold beyond which files are written directly to disk, in bytes
# Only used while uploading multipart form data files

# File System

The following configuration options are supported:

HTTP related configurations:

  • https.enabled (Optional): if the HTTPS is enabled (default is false). If is set to true you must provide the others https properties.
  • https.port: the port where the server will listen for HTTPS requests.
  • https.keystore: the HTTPS keystore location.
  • https.keystore.type: the keystore type.
  • https.keystore.password: the keystore password.
  • https.key.password: the HTTPS key password.
  • http.port (Optional): the HTTP port where the server will listen for HTTP requests (default is 8080).
  • http.tests.port (Optional): the HTTP port where the server will listen for HTTP requests while running tests (default is 9090).

XMPP related:

  • (Required): the XMPP server location where the media server's component will connect.
  • xmpp.component.port (Required): the XMPP server components connection listening port.
  • xmpp.component.subdomain (Required): the subdomain that will be used by the component.
  • xmpp.component.secretkey (Required): the secretkey defined at the XMPP server for components connections.

In addition of the component, the media server also have a simple client that handles pubsub queries:

  • xmpp.connection.username (Required): the username used by the cient's connection.
  • xmpp.connection.password (Required): client's connection password.
  • (Required): XMPP server location.
  • xmpp.connection.port (Required): XMPP server port for clients connections.
  • xmpp.connection.servicename (Required): client's connection servicename.

  • xmpp.reply.timeout (Optional): timeout in milliseconds to wait a response to an XMPP request (default is 30000)

Storage related:

  • jdbc.db.url (Required): the server uses PostgresSQL to store media's metadata and uses JDBC to access it.
  • jdbc.driver.class (Optional): if someday the media server allow a different database, this property will be used (default is org.postgresql.Driver).
  • (Required): root path where the media server will store the media files.
  • media.sizelimit (Optional): the tolerated file content size which the media server will store (default is 104857600 - 100 MB).
  • media.todisk.threshold (Optional): the tolerated file size in bytes (default is 1048576 - 1 MB) which beyond are directly stored on disk.
Something went wrong with that request. Please try again.