java.lang.Object
com.inductiveautomation.ignition.common.resourcecollection.AbstractResource
com.inductiveautomation.ignition.common.resourcecollection.ImmutableResource
All Implemented Interfaces:
Resource

public class ImmutableResource extends AbstractResource
  • Method Details

    • getData

      @Nonnull public Optional<ImmutableBytes> getData(String key)
      Description copied from interface: Resource
      Retrieve the data for the given key (filename) as an ImmutableBytes. Consider using Resource.getDataStream(String) instead.
    • getDataStream

      public Optional<InputStream> getDataStream(String key)
      Description copied from interface: Resource
      Retrieve the data for the given key (filename) as an input stream. Depending on the Resource implementation, this may be more memory efficient than Resource.getData(String).
    • getDataReader

      public Optional<Reader> getDataReader(String key)
      Description copied from interface: Resource
      Retrieve the data for the given key (filename) as a reader. Reader will be opened with UTF-8 encoding. This may be more memory efficient than using Resource.getData(String), especially for parsing large JSON files, for example.
    • getDataDigest

      public Optional<String> getDataDigest(String key)
      Description copied from interface: Resource
      The "digest" is a unique fingerprint for the data file. Calculated as a sha-256 hash and then encoded to a string as hex. Reference implementation looks like:
           getData(key).map(bytes -> DigestBuilder.sha256().update(bytes).buildHexString());
       
    • getDataKeys

      @Nonnull public com.google.common.collect.ImmutableSet<String> getDataKeys()
      Description copied from interface: Resource
      Get an immutable view of the data key set.
      Returns:
      an immutable view of the data key set.
    • getContentDigest

      public ImmutableBytes getContentDigest()
      Description copied from interface: Resource
      Get the SHA-256 digest of the content of this resource. This does not include the project name or any part of the path to this resource, but rather, it's a representation of the contents of the folder on disk.

      Any changes to any of the resource contents of that folder shall result in a change to the content digest.

      Returns:
      the SHA-256 digest of the content of this resource.
      See Also:
    • getResourceSignature

      public ResourceSignature getResourceSignature()
      Description copied from interface: Resource
      Get the ResourceSignature for this resource.
      Returns:
      the ResourceSignature for this resource.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object