Package org.opennms.netmgt.rrd
Class RrdFileConstants
- java.lang.Object
-
- org.opennms.netmgt.rrd.RrdFileConstants
-
public class RrdFileConstants extends java.lang.Object
A convenience class containing RRD file and directory related constants.- Author:
- Mike Davidson , Lawrence Karnowski
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_RRD_FILENAME_LENGTH
The 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.String
convertToValidRrdName(java.lang.String rrd)
Note this method will not handle references to higher directories ("..").static java.lang.String
escapeForGraphing(java.lang.String path)
static boolean
isValidRRDLatencyDir(java.io.File file, java.lang.String suffix)
Determines if the provided File object represents a valid RRD latency directory.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.
-
-
-
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
- aFile
object.- 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_LENGTH
constant. 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
- aString
object.- 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
- aString
object.- Returns:
- a
String
object.
-
escapeForGraphing
public static java.lang.String escapeForGraphing(java.lang.String path)
-
-