本文整理汇总了Java中org.apache.commons.io.FileUtils.ONE_MB属性的典型用法代码示例。如果您正苦于以下问题:Java FileUtils.ONE_MB属性的具体用法?Java FileUtils.ONE_MB怎么用?Java FileUtils.ONE_MB使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.io.FileUtils
的用法示例。
在下文中一共展示了FileUtils.ONE_MB属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
/**
* Lifecycle method. Should be called immediately after constructing objects of this type (e.g. by the
* Spring framework's application context).
*/
public void init()
{
if (log.isDebugEnabled())
{
log.debug("Starting quota strategy.");
}
PropertyCheck.mandatory(this, "cleaner", cleaner);
PropertyCheck.mandatory(this, "cache", cache);
if (maxUsageBytes < (10 * FileUtils.ONE_MB))
{
if (log.isWarnEnabled())
{
log.warn("Low maxUsageBytes of " + maxUsageBytes + "bytes - did you mean to specify in MB?");
}
}
loadDiskUsage();
// Set the time to start the normal clean
lastCleanupStart.set(System.currentTimeMillis() - normalCleanThresholdSec);
// Run the cleaner thread so that it can update the disk usage more accurately.
signalCleanerStart("quota (init)");
}
示例2: getMaxFileSizeBytes
protected long getMaxFileSizeBytes()
{
return maxFileSizeMB * FileUtils.ONE_MB;
}
示例3: getSizeFilesDeletedMB
public double getSizeFilesDeletedMB()
{
return (double) getSizeFilesDeleted() / FileUtils.ONE_MB;
}
示例4: getCurrentUsageMB
public double getCurrentUsageMB()
{
return (double) getCurrentUsageBytes() / FileUtils.ONE_MB;
}
示例5: getMaxUsageMB
public long getMaxUsageMB()
{
return maxUsageBytes / FileUtils.ONE_MB;
}