本文整理匯總了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;
}