Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • RrdFileConstants

        public RrdFileConstants()
    • 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 - a File 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 the MAX_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 - a String 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 - a String object.
        Returns:
        a String object.
      • escapeForGraphing

        public static java.lang.String escapeForGraphing​(java.lang.String path)