Class PropertyCacheFile

java.lang.Object
com.puppycrawl.tools.checkstyle.PropertyCacheFile

public final class PropertyCacheFile extends Object
This class maintains a persistent(on file-system) store of the files that have checked ok(no validation events) and their associated timestamp. It is used to optimize Checkstyle between few launches. It is mostly useful for plugin and extensions of Checkstyle. It uses a property file for storage. A hashcode of the Configuration is stored in the cache file to ensure the cache is invalidated when the configuration has changed.
  • Field Details

    • CONFIG_HASH_KEY

      public static final String CONFIG_HASH_KEY
      The property key to use for storing the hashcode of the configuration. To avoid name clashes with the files that are checked the key is chosen in such a way that it cannot be a valid file name.
      See Also:
    • EXTERNAL_RESOURCE_KEY_PREFIX

      The property prefix to use for storing the hashcode of an external resource. To avoid name clashes with the files that are checked the prefix is chosen in such a way that it cannot be a valid file name and makes it clear it is a resource.
      See Also:
    • BUFFER_SIZE

      private static final int BUFFER_SIZE
      Size of default byte array for buffer.
      See Also:
    • BUFFER

      private static final byte[] BUFFER
      Default buffer for reading from streams.
    • BASE_16

      private static final int BASE_16
      Default number for base 16 encoding.
      See Also:
    • details

      private final Properties details
      The details on files.
    • config

      private final Configuration config
      Configuration object.
    • fileName

      private final String fileName
      File name of cache.
    • configHash

      Generated configuration hash.
  • Constructor Details

  • Method Details