Package org.olat.core.gui.media

Examples of org.olat.core.gui.media.FileMediaResource


    if (isLogDebugEnabled()) {
      logDebug("Serving resource URI::" + request.getRequestURI(), null);
    }
    // Everything is ok, serve resource
    MediaResource resource = new FileMediaResource(staticFile);
    ServletUtil.serveResource(request, response, resource);
  }
View Full Code Here


   */
  public MediaResource getPortrait(Identity identity, String portraitName){
    MediaResource imageResource = null;
    File imgFile = new File(getPortraitDir(identity), portraitName);
    if (imgFile.exists()){
      imageResource = new FileMediaResource(imgFile)
    }
    return imageResource;
  }
View Full Code Here

   */
  public MediaResource getPortrait(File uploadDir, String portraitName){
    MediaResource imageResource = null;
    File imgFile = new File(uploadDir, portraitName);
    if (imgFile.exists()){
      imageResource = new FileMediaResource(imgFile)
    }
    return imageResource;
  }
View Full Code Here

          cmc = new CloseableModalController(getWindowControl(), translator.translate("close"), iframeCtr.getInitialComponent());
          cmc.activate();
        }

      } else {
        ureq.getDispatchResult().setResultingMediaResource(new FileMediaResource(new File(fTaskfolder, assignedTask)));
      }
    } else if (source == statusForm) {
      if (event == Form.EVNT_VALIDATION_OK) {
        // get identity not from request (this would be an author)
        StatusManager.getInstance().saveStatusFormData(statusForm,node,userCourseEnv);
View Full Code Here

        getImageFilename(repositoryEntry));
    if (!repositoryEntryImageFile.exists()) {
      return null;
    }
    ImageComponent imageComponent = new ImageComponent(componentName);
    imageComponent.setMediaResource(new FileMediaResource(repositoryEntryImageFile));
    return imageComponent;
  }
View Full Code Here

  public void execute(HttpServletRequest request, HttpServletResponse response, String uriPrefix) {
    if(!this.reInitialize())
      Tracing.logError("Some Failsaves in reInitialization needed !", CatalogExportModuleDispatcher.class);
      try {
        Tracing.logInfo("Catalog XML file requested by " + request.getRemoteAddr(), CatalogExportModuleDispatcher.class);
        ServletUtil.serveResource(request, response, new FileMediaResource(CatalogExportModuleDispatcher.getFile(), true));
      } catch (Exception e) {
        Tracing.logError("Error requesting catalog export file: ", e, CatalogExportModuleDispatcher.class);
        try {
          ServletUtil.serveResource(request, response, new NotFoundMediaResource(request.getRequestURI()));
        } catch (Exception e1) {
View Full Code Here

    else if (source == backLinkAtDelimChoose){
      wc.setWizardTitle(getTranslator().translate("wizard.optionschoose.title"));
      wc.setBackWizardStep(getTranslator().translate("wizard.optionschoose.howto"), optionsChooseVC);
    }
    else if (source == showFileButton){
      ureq.getDispatchResult().setResultingMediaResource(new FileMediaResource(new File(exportDir, targetFileName), true));
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.media.FileMediaResource

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.