Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface BinaryBodyManager

All Superinterfaces:
JiveManager

public interface BinaryBodyManager
extends JiveManager

Manages binary body settings. There are three main properties that can administered with respect to document bodies:

See Also:
BinaryBody

Method Summary
 void addAllowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly allowed types.
 void addDisallowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly disallowed types.
 java.util.List<java.lang.String> getAllowedTypes()
          Returns a list of explicitly allowed types.
 java.util.List<java.lang.String> getAllowedTypesAsFileExtensions()
          Returns a list of explicitly allowed file types by extensions.
 java.io.InputStream getBinaryBodyByID(long binaryBodyID)
          Retrieve a binary body by its ID.
 java.util.List<java.lang.String> getDisallowedTypes()
          Returns a list of explicitly disallowed types.
 java.util.List<java.lang.String> getDisallowedTypesAsFileExtensions()
          Returns a list of explicitly disallowed file types by default extensions.
 int getMaxBodySize()
          Returns the maximum size of an individual binary document body in kilobytes.
 boolean isAllowAllByDefault()
          Returns true if in the "allow all content types by default" mode.
 boolean isBinaryBodyEnabled()
          Returns true if the documents can contain binary body data, false if they can only contain textual bodies.
 boolean isValidType(java.lang.String contentType)
          Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.
 void removeAllowedType(java.lang.String contentType)
          Removes a content type fromt he list of explicitly allowed types.
 void removeDisallowedType(java.lang.String contentType)
          Removes a content type from the list of explicitly disallowed types.
 void setAllowAllByDefault(boolean allowAllByDefault)
          Sets the default allowed content types mode.
 void setBinaryBodyEnabled(boolean enabled)
          Enables or disables binary document bodies.
 void setMaxBodySize(int maxBodySize)
          Sets the maximum size of an individual binary document body in kilobytes.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

isBinaryBodyEnabled

boolean isBinaryBodyEnabled()
Returns true if the documents can contain binary body data, false if they can only contain textual bodies.

Returns:
true if documents can contain binary body data, false otherwise.

setBinaryBodyEnabled

void setBinaryBodyEnabled(boolean enabled)
                          throws UnauthorizedException
Enables or disables binary document bodies. If disabled, documents may only contain textual bodies.

Parameters:
enabled - true if documents can contain binary body data, false otherwise.
Throws:
UnauthorizedException - if not a system administrator.

getMaxBodySize

int getMaxBodySize()
Returns the maximum size of an individual binary document body in kilobytes. Trying to create a binary document body larger than the max size will fail with an exception. The default maximum binary body size is 15 megabytes, or 15,360 K.

Returns:
the max size in kilobytes of a binary document body.

setMaxBodySize

void setMaxBodySize(int maxBodySize)
                    throws UnauthorizedException
Sets the maximum size of an individual binary document body in kilobytes. Trying to create a binary document body larger than the max size will fail with an exception. The default maximum binary document body size is 15 megabytes, or 15,360 K.

Parameters:
maxBodySize - the max size in kilobytes of a binary document body.
Throws:
UnauthorizedException - if not an administrator.

isValidType

boolean isValidType(java.lang.String contentType)
Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.

Parameters:
contentType - the content type to test.
Returns:
true if the content type is valid.

addAllowedType

void addAllowedType(java.lang.String contentType)
                    throws UnauthorizedException
Adds a content type to the list of explicitly allowed types.

Parameters:
contentType - a content type to add to the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeAllowedType

void removeAllowedType(java.lang.String contentType)
                       throws UnauthorizedException
Removes a content type fromt he list of explicitly allowed types. If the given content type does not exist in the list, this method does nothing.

Parameters:
contentType - a content type to remove from the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

getAllowedTypes

java.util.List<java.lang.String> getAllowedTypes()
Returns a list of explicitly allowed types.

Returns:
a list of all explicitly allowed types.

getAllowedTypesAsFileExtensions

java.util.List<java.lang.String> getAllowedTypesAsFileExtensions()
Returns a list of explicitly allowed file types by extensions. For example, image/png would return .png. Since not all allowed mime types may have a ful list of extensions (e.g. application/octet-stream) it's possible that an extension will not be present in the returned list that otherwise will be a valid extension.


addDisallowedType

void addDisallowedType(java.lang.String contentType)
                       throws UnauthorizedException
Adds a content type to the list of explicitly disallowed types.

Parameters:
contentType - a content type to add to the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeDisallowedType

void removeDisallowedType(java.lang.String contentType)
                          throws UnauthorizedException
Removes a content type from the list of explicitly disallowed types.

Parameters:
contentType - a content type to remove from the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

getDisallowedTypes

java.util.List<java.lang.String> getDisallowedTypes()
Returns a list of explicitly disallowed types.

Returns:
a list of all explicitly disallowed types.

getDisallowedTypesAsFileExtensions

java.util.List<java.lang.String> getDisallowedTypesAsFileExtensions()
Returns a list of explicitly disallowed file types by default extensions. For example, image/png would return .png.


isAllowAllByDefault

boolean isAllowAllByDefault()
Returns true if in the "allow all content types by default" mode. The alternative is that all content types are disallowed unless they're on the "allowed" list.

Returns:
true if all content types are allowed by default.

setAllowAllByDefault

void setAllowAllByDefault(boolean allowAllByDefault)
                          throws UnauthorizedException
Sets the default allowed content types mode. The value true means that all content types will be allowed unless they're on the "disallowed list". If false, no content types will be allowed unless on the "allowed list".

Parameters:
allowAllByDefault - true if all content types should be allowed by default.
Throws:
UnauthorizedException - if not an administrator.

getBinaryBodyByID

java.io.InputStream getBinaryBodyByID(long binaryBodyID)
Retrieve a binary body by its ID.

Parameters:
binaryBodyID - The ID of the binary body.
Returns:
An input stream of the binary body data.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.