Class LegacyVOMSESParserImpl

java.lang.Object
org.italiangrid.voms.request.impl.LegacyVOMSESParserImpl
All Implemented Interfaces:
VOMSESParser

public class LegacyVOMSESParserImpl extends Object implements VOMSESParser
Implementation of the VOMSESParser interface. This class is responsible for parsing VOMSES configuration files and extracting VOMSServerInfo instances from them.

It supports parsing from files, directories, and readers, and ensures that the VOMSES files exist and are readable before processing.

VOMSES files typically contain server connection information in a structured format.

  • Field Details

    • lineParser

      private final VOMSESLineParser lineParser
      Line parser used to process individual VOMSES lines.
  • Constructor Details

    • LegacyVOMSESParserImpl

      public LegacyVOMSESParserImpl()
  • Method Details

    • fileSanityChecks

      protected void fileSanityChecks(File f)
      Performs basic sanity checks on the provided file.
      Parameters:
      f - the file to check
      Throws:
      VOMSError - if the file does not exist or is not readable
    • parseLine

      protected VOMSServerInfo parseLine(String vomsesLine) throws URISyntaxException
      Parses a single line from a VOMSES file.
      Parameters:
      vomsesLine - the line to parse
      Returns:
      a VOMSServerInfo instance representing the parsed line
      Throws:
      URISyntaxException - if the URI in the line is malformed
    • parse

      public List<VOMSServerInfo> parse(Reader vomsesReader)
      Parses VOMSES configuration from a Reader.
      Specified by:
      parse in interface VOMSESParser
      Parameters:
      vomsesReader - the reader containing VOMSES configuration
      Returns:
      a list of VOMSServerInfo instances extracted from the input
    • parseDirectory

      protected List<VOMSServerInfo> parseDirectory(File directory)
      Parses all VOMSES files in a given directory.
      Parameters:
      directory - the directory containing VOMSES files
      Returns:
      a list of VOMSServerInfo instances parsed from the directory
    • parse

      public List<VOMSServerInfo> parse(File f)
      Parses a VOMSES file or directory.
      Specified by:
      parse in interface VOMSESParser
      Parameters:
      f - the file or directory to parse
      Returns:
      a list of VOMSServerInfo instances parsed from the file/directory
      Throws:
      VOMSError - if the file is not found or an error occurs during parsing