Package org.opennms.netmgt.rrd
Class RrdFileConstants
- java.lang.Object
-
- org.opennms.netmgt.rrd.RrdFileConstants
-
public class RrdFileConstants extends java.lang.ObjectA convenience class containing RRD file and directory related constants.- Author:
- Mike Davidson , Lawrence Karnowski
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_RRD_FILENAME_LENGTHThe longest an RRD filename can be, currently 1024 characters.
-
Constructor Summary
Constructors Constructor Description RrdFileConstants()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringconvertToValidRrdName(java.lang.String rrd)Note this method will not handle references to higher directories ("..").static java.lang.StringescapeForGraphing(java.lang.String path)static booleanisValidRRDLatencyDir(java.io.File file, java.lang.String suffix)Determines if the provided File object represents a valid RRD latency directory.static booleanisValidRRDName(java.lang.String rrd)Checks an RRD filename to make sure it is of the proper length and does not contain any unexpected charaters.
-
-
-
Field Detail
-
MAX_RRD_FILENAME_LENGTH
public static final int MAX_RRD_FILENAME_LENGTH
The longest an RRD filename can be, currently 1024 characters.- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidRRDLatencyDir
public static final boolean isValidRRDLatencyDir(java.io.File file, java.lang.String suffix)Determines if the provided File object represents a valid RRD latency directory.- Parameters:
file- aFileobject.- Returns:
- a boolean.
-
isValidRRDName
public static boolean isValidRRDName(java.lang.String rrd)
Checks an RRD filename to make sure it is of the proper length and does not contain any unexpected charaters. The maximum length is specified by theMAX_RRD_FILENAME_LENGTHconstant. The only valid characters are letters (A-Z and a-z), numbers (0-9), dashes (-), dots (.), and underscores (_). These precautions are necessary since the RRD filename is used on the commandline and specified in the graph URL.- Parameters:
rrd- aStringobject.- Returns:
- a boolean.
-
convertToValidRrdName
public static java.lang.String convertToValidRrdName(java.lang.String rrd)
Note this method will not handle references to higher directories ("..").- Parameters:
rrd- aStringobject.- Returns:
- a
Stringobject.
-
escapeForGraphing
public static java.lang.String escapeForGraphing(java.lang.String path)
-
-