Search in sources :

Example 6 with ZippedDirectoryMediaResource

use of org.olat.fileresource.ZippedDirectoryMediaResource in project openolat by klemens.

the class EvaluationFormHandler method getAsMediaResource.

/**
 * Transform the map in a XML file and zip it (Repository export want a zip)
 * @see org.olat.repository.handlers.RepositoryHandler#getAsMediaResource(org.olat.core.id.OLATResourceable)
 */
@Override
public MediaResource getAsMediaResource(OLATResourceable res, boolean backwardsCompatible) {
    File unzippedDir = FileResourceManager.getInstance().unzipFileResource(res);
    String displayName = repositoryManager.lookupDisplayNameByOLATResourceableId(res.getResourceableId());
    return new ZippedDirectoryMediaResource(displayName, unzippedDir);
}
Also used : ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource) File(java.io.File)

Example 7 with ZippedDirectoryMediaResource

use of org.olat.fileresource.ZippedDirectoryMediaResource in project OpenOLAT by OpenOLAT.

the class ImsCPHandler method getAsMediaResource.

@Override
public MediaResource getAsMediaResource(OLATResourceable res, boolean backwardsCompatible) {
    File unzippedDir = FileResourceManager.getInstance().unzipFileResource(res);
    String displayName = CoreSpringFactory.getImpl(RepositoryManager.class).lookupDisplayNameByOLATResourceableId(res.getResourceableId());
    return new ZippedDirectoryMediaResource(displayName, unzippedDir);
}
Also used : ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource) RepositoryManager(org.olat.repository.RepositoryManager) File(java.io.File)

Example 8 with ZippedDirectoryMediaResource

use of org.olat.fileresource.ZippedDirectoryMediaResource in project openolat by klemens.

the class SCORMCPHandler method getAsMediaResource.

@Override
public MediaResource getAsMediaResource(OLATResourceable res, boolean backwardsCompatible) {
    File unzippedDir = FileResourceManager.getInstance().unzipFileResource(res);
    String displayName = CoreSpringFactory.getImpl(RepositoryManager.class).lookupDisplayNameByOLATResourceableId(res.getResourceableId());
    return new ZippedDirectoryMediaResource(displayName, unzippedDir);
}
Also used : ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource) RepositoryManager(org.olat.repository.RepositoryManager) File(java.io.File)

Aggregations

ZippedDirectoryMediaResource (org.olat.fileresource.ZippedDirectoryMediaResource)8 File (java.io.File)6 RepositoryManager (org.olat.repository.RepositoryManager)4 FileMediaResource (org.olat.core.gui.media.FileMediaResource)2 MediaResource (org.olat.core.gui.media.MediaResource)2