Package org.italiangrid.voms.request.impl

# 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.

## Constructor Summary

Constructors
Constructor
Description
`LegacyVOMSESParserImpl()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`fileSanityChecks(File f)`
Performs basic sanity checks on the provided file.
`List<VOMSServerInfo>`
`parse(File f)`
Parses a VOMSES file or directory.
`List<VOMSServerInfo>`
`parse(Reader vomsesReader)`
Parses VOMSES configuration from a `Reader`.
`protected List<VOMSServerInfo>`
`parseDirectory(File directory)`
Parses all VOMSES files in a given directory.
`protected VOMSServerInfo`
`parseLine(String vomsesLine)`
Parses a single line from a VOMSES file.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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