Package pt.webdetails.cpf.resources

Examples of pt.webdetails.cpf.resources.IResourceLoader


  }

  private void returnResource( final String urlPath, final OutputStream out ) throws Exception {
    final IParameterProvider pathParams = parameterProviders.get( Parameter.PATH ); //$NON-NLS-1$

    final IResourceLoader resLoader = CdfEngine.getEnvironment().getResourceLoader();
    final String maxAge = resLoader.getPluginSetting( CdfContentGenerator.class, "settings/max-age" );
    final HttpServletResponse response = (HttpServletResponse) pathParams.getParameter( "httpresponse" );
    if ( maxAge != null && response != null ) {
      response.setContentType( MimeTypes.getMimeType( urlPath ) );
      response.setHeader( "Cache-Control", "max-age=" + maxAge );
    }
View Full Code Here


    }
  }

  public void getSolutionFile( final String resourcePath, final OutputStream out ) throws Exception {

    final IResourceLoader resLoader = CdfEngine.getEnvironment().getResourceLoader();
    final String formats =
      resLoader.getPluginSetting( this.getClass(), CdfConstants.PLUGIN_SETTINGS_DOWNLOADABLE_FORMATS );

    List<String> allowedFormats = Arrays.asList( StringUtils.split( formats, ',' ) );
    String extension = resourcePath.replaceAll( ".*\\.(.*)", "$1" );
    if ( allowedFormats.indexOf( extension ) < 0 ) {
      // We can't provide this type of file
View Full Code Here

    CACHEABLE_EXTENSIONS.add( "html" );
    CACHEABLE_EXTENSIONS.add( "json" );
    CACHEABLE_EXTENSIONS.add( "cdfde" );

    final IResourceLoader resLoader = CdfEngine.getEnvironment().getResourceLoader();
    this.isCacheEnabled =
        Boolean.parseBoolean( resLoader.getPluginSetting( this.getClass(), "pentaho-cdf-dd/enable-cache" ) );
  }
View Full Code Here

TOP

Related Classes of pt.webdetails.cpf.resources.IResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.