use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.
the class FolderCallback method initFolderQuota.
private void initFolderQuota(String relPath) {
QuotaManager qm = QuotaManager.getInstance();
folderQuota = qm.getCustomQuota(relPath);
if (folderQuota == null) {
Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER);
folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
}
use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.
the class FolderNodeCallback method getQuota.
/**
* @see org.olat.modules.bc.callbacks.SecurityCallback#getQuotaKB(org.olat.modules.bc.Path)
*/
@Override
public Quota getQuota() {
if (nodeFolderQuota == null) {
QuotaManager qm = QuotaManager.getInstance();
nodeFolderQuota = qm.getCustomQuota(relPath);
if (nodeFolderQuota == null) {
Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES);
nodeFolderQuota = qm.createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
}
return nodeFolderQuota;
}
use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class GenericQuotaEditController method event.
@Override
public void event(UserRequest ureq, Controller source, Event event) {
if (source == quotaForm) {
if (event == Event.DONE_EVENT) {
QuotaManager qm = QuotaManager.getInstance();
currentQuota = QuotaManager.getInstance().createQuota(quotaForm.getPath(), new Long(quotaForm.getQuotaKB()), new Long(quotaForm.getULLimit()));
qm.setCustomQuotaKB(currentQuota);
fireEvent(ureq, Event.CHANGED_EVENT);
}
}
}
use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.
the class FullAccessWithLazyQuotaCallback method getQuota.
@Override
public Quota getQuota() {
if (super.getQuota() == null) {
QuotaManager qm = QuotaManager.getInstance();
Quota q = qm.getCustomQuota(folderPath);
if (q == null) {
Quota defQuota = qm.getDefaultQuota(defaultQuota);
q = QuotaManager.getInstance().createQuota(folderPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
super.setQuota(q);
}
return super.getQuota();
}
use of org.olat.core.util.vfs.QuotaManager in project OpenOLAT by OpenOLAT.
the class GenericQuotaViewController method initMyContent.
private void initMyContent() {
QuotaManager qm = QuotaManager.getInstance();
myContent = createVelocityContainer("edit");
myContent.contextPut("notEnoughPrivilege", Boolean.FALSE);
myContent.contextPut("users", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
myContent.contextPut("powerusers", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
myContent.contextPut("groups", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS));
myContent.contextPut("repository", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_REPO));
myContent.contextPut("coursefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE));
myContent.contextPut("nodefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES));
myContent.contextPut("feeds", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_FEEDS));
}
Aggregations