ariba.util.log
Class ConstrainedDirectory

java.lang.Object
  extended by java.io.File
      extended by ariba.util.log.ConstrainedDirectory
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>

public class ConstrainedDirectory
extends java.io.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

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
ConstrainedDirectory(java.io.File path)
           
ConstrainedDirectory(java.io.File path, Logger logger)
           
ConstrainedDirectory(java.io.File path, java.lang.String file)
           
ConstrainedDirectory(java.io.File path, java.lang.String file, Logger logger)
           
ConstrainedDirectory(java.lang.String path)
           
ConstrainedDirectory(java.lang.String path, Logger logger)
           
ConstrainedDirectory(java.lang.String path, java.lang.String file)
           
ConstrainedDirectory(java.lang.String path, java.lang.String file, Logger logger)
           
 
Method Summary
 java.io.File fileAt(int index)
           
 boolean instantiate()
           
 java.util.List listing()
           
 void LogError(java.lang.String message)
           
 int purge(int megaBytesToPurge)
          Purges a specified number of bytes (in megabytes) from this constrained directory
 int purgeOnConstraint()
          Purges this constrained directory of any bytes in excess of the max size allowed.
 boolean scan()
           
 void setMaxMegaBytes(int maxMegaBytes)
          Sets the max size of this contrained directory in mega bytes.
 void sortOnDate()
           
 long sumBytes()
           
 int sumMegaBytes()
           
 int testConstraints()
          returns the number of mega bytes to purge
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstrainedDirectory

public ConstrainedDirectory(java.io.File path)

ConstrainedDirectory

public ConstrainedDirectory(java.io.File path,
                            Logger logger)

ConstrainedDirectory

public ConstrainedDirectory(java.lang.String path)

ConstrainedDirectory

public ConstrainedDirectory(java.lang.String path,
                            Logger logger)

ConstrainedDirectory

public ConstrainedDirectory(java.lang.String path,
                            java.lang.String file)

ConstrainedDirectory

public ConstrainedDirectory(java.lang.String path,
                            java.lang.String file,
                            Logger logger)

ConstrainedDirectory

public ConstrainedDirectory(java.io.File path,
                            java.lang.String file)

ConstrainedDirectory

public ConstrainedDirectory(java.io.File path,
                            java.lang.String file,
                            Logger logger)
Method Detail

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 java.util.List listing()

fileAt

public java.io.File fileAt(int index)

sumMegaBytes

public int sumMegaBytes()

sumBytes

public long sumBytes()

instantiate

public boolean instantiate()

LogError

public void LogError(java.lang.String message)

scan

public boolean scan()

sortOnDate

public void sortOnDate()


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.