Class PropertiesResource

java.lang.Object
overit.geocall.config.company.PropertiesResource

public class PropertiesResource extends Object
class containing the configurations related to the resources.
note: all the configuration refers to the company whose the identity belongs to.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Static constant to identify the resources saved into the Azure Blob Storage service
    static final String
    Static constant to identify the resources saved into a container's folder
    static final String
    Static constant to identify the resources saved into the database
    static final String
    Static constant to identify the resources saved into the file system
    static final String
    Static constant to identify the resources saved into the AWS S3 service
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Gets the file formats allowed for upload.
    static String
    base(Company company)
    the directory path the resources are saved in.
    static overit.geocall.servlet.WebResourceFactory
    Helper method to get the instance of the WebResourceFactory.
    static String
    type(Company company)
    Get the persistence method of the web resources.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TYPE_CONTAINER

      public static final String TYPE_CONTAINER
      Static constant to identify the resources saved into a container's folder
      See Also:
    • TYPE_FS

      public static final String TYPE_FS
      Static constant to identify the resources saved into the file system
      See Also:
    • TYPE_DB

      public static final String TYPE_DB
      Static constant to identify the resources saved into the database
      See Also:
    • TYPE_S3

      public static final String TYPE_S3
      Static constant to identify the resources saved into the AWS S3 service
      See Also:
    • TYPE_BLOB_STORAGE

      public static final String TYPE_BLOB_STORAGE
      Static constant to identify the resources saved into the Azure Blob Storage service
      See Also:
  • Method Details

    • getFactory

      public static overit.geocall.servlet.WebResourceFactory getFactory()
      Helper method to get the instance of the WebResourceFactory. The effective implementation is based on the type(Company) configuration
      Returns:
      the instance of the WebResourceFactory tht can be used to get the reference of a WebResource .
    • type

      public static String type(Company company)
      Get the persistence method of the web resources. Supported values are:
      • fs: to save the resources in file system
      • db: to save them into DB table
      • s3: to save them into a AWS S3 bucket
      • class: a class path to implement a custom persistence logic
      Parameters:
      company - the company from which extract the configuration
      Returns:
      the persistence method of the web resources. If there's no type configured, this method will return an empty string.
    • base

      public static String base(Company company)
      the directory path the resources are saved in. Works only if the company.resources.type configuration has been set up to FS
      Parameters:
      company - the company from which extract the configuration
      Returns:
      the directory path the resources are saved in. If there's no base configured, this method will a null value web directory.
    • allowTypes

      public static String allowTypes(Company company)
      Gets the file formats allowed for upload.
      This property it's used to define a list of allowed file type/extensions that can be selected for upload into the system.
      It's possible to restrict the accepted file using the following rules:
      • file_extension: A file extension starting with the dot character, e.g: .gif, .jpg, .png, .doc
      • audio/*: All sound files are accepted
      • video/*: All video files are accepted
      • image/*: All image files are accepted
      • media_type: A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types
      • *: All files are accepted
      To specify more than one value, separate the values with a comma (e.g. "audio/*,video/*,image/*")
      Parameters:
      company - the company from which extract the configuration
      Returns:
      the file formats allowed for upload.