Search in sources :

Example 1 with ZippedDirectoryMediaResource

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

the class DirectoryController method doBulkdownload.

private void doBulkdownload(UserRequest ureq) {
    MediaResource mdr = new ZippedDirectoryMediaResource(zipName, documentsDir);
    ureq.getDispatchResult().setResultingMediaResource(mdr);
}
Also used : ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource) FileMediaResource(org.olat.core.gui.media.FileMediaResource) MediaResource(org.olat.core.gui.media.MediaResource) ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource)

Example 2 with ZippedDirectoryMediaResource

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

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 3 with ZippedDirectoryMediaResource

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

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)

Example 4 with ZippedDirectoryMediaResource

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

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 5 with ZippedDirectoryMediaResource

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

the class DirectoryController method doBulkdownload.

private void doBulkdownload(UserRequest ureq) {
    MediaResource mdr = new ZippedDirectoryMediaResource(zipName, documentsDir);
    ureq.getDispatchResult().setResultingMediaResource(mdr);
}
Also used : ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource) FileMediaResource(org.olat.core.gui.media.FileMediaResource) MediaResource(org.olat.core.gui.media.MediaResource) ZippedDirectoryMediaResource(org.olat.fileresource.ZippedDirectoryMediaResource)

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