ariba.util.log
Class ConstrainedDirectory
java.lang.Object
java.io.File
ariba.util.log.ConstrainedDirectory
- All Implemented Interfaces:
- Serializable, Comparable<File>
public class ConstrainedDirectory
- extends File
A subclass Directory whose size can be "constrained": methods are provided
to purge the contents of the directory until the size is reduced to a specified
value in megabytes.
- See Also:
- Serialized Form
| Methods inherited from class java.io.File |
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
ConstrainedDirectory
public ConstrainedDirectory(File path)
ConstrainedDirectory
public ConstrainedDirectory(File path,
Logger logger)
ConstrainedDirectory
public ConstrainedDirectory(String path)
ConstrainedDirectory
public ConstrainedDirectory(String path,
Logger logger)
ConstrainedDirectory
public ConstrainedDirectory(String path,
String file)
ConstrainedDirectory
public ConstrainedDirectory(String path,
String file,
Logger logger)
ConstrainedDirectory
public ConstrainedDirectory(File path,
String file)
ConstrainedDirectory
public ConstrainedDirectory(File path,
String file,
Logger logger)
setMaxMegaBytes
public void setMaxMegaBytes(int maxMegaBytes)
- Sets the max size of this contrained directory in mega bytes.
- Parameters:
maxMegaBytes - the max size of this contrained directory in mega bytes
purgeOnConstraint
public int purgeOnConstraint()
- Purges this constrained directory of any bytes in
excess of the max size allowed.
- Returns:
- the number of Mega bytes purged.
testConstraints
public int testConstraints()
- returns the number of mega bytes to purge
purge
public int purge(int megaBytesToPurge)
- Purges a specified number of bytes (in megabytes)
from this constrained directory
- Parameters:
megaBytesToPurge - the size in Mega Bytes to purge
- Returns:
- the number of Mega bytes purged
listing
public List listing()
fileAt
public File fileAt(int index)
sumMegaBytes
public int sumMegaBytes()
sumBytes
public long sumBytes()
instantiate
public boolean instantiate()
LogError
public void LogError(String message)
scan
public boolean scan()
sortOnDate
public void sortOnDate()
AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.