Class EnvToPropsConverter

java.lang.Object
org.glassfish.main.jdke.props.EnvToPropsConverter

public final class EnvToPropsConverter extends Object
Given a file, tries to resolve given keys to absolute paths.
Author:
David Matejcek
  • Constructor Details

    • EnvToPropsConverter

      public EnvToPropsConverter(Path relativePathAnchor)
      Parameters:
      relativePathAnchor - absolute path; will be normalized.
  • Method Details

    • convert

      public Map<String,File> convert(Map<String,String> envToSysMappings)
      Tries to resolve given keys. Then if the retrieved value is relative, it is resolved against the anchor path from constructor. The resolved file is added to the resulting map using the input map's value as a key. There is no guarantee the file does exist.
      Parameters:
      envToSysMappings - - key is env name, value is system property name.
      Returns:
      map of system property names and absolute files.
    • convert

      public File convert(String envPropertyName, String systemPropertyName)
      Tries to resolve given keys. Then if the retrieved value is relative, it is resolved against the anchor path from constructor.
      Parameters:
      envPropertyName - - can be null, then it is ignored.
      systemPropertyName - - can be null, then it is ignored.
      Returns:
      file - there is no guarantee the file does exist.