Class LegacyVOMSESParserImpl
- java.lang.Object
-
- org.italiangrid.voms.request.impl.LegacyVOMSESParserImpl
-
- All Implemented Interfaces:
VOMSESParser
public class LegacyVOMSESParserImpl extends java.lang.Object implements VOMSESParser
Implementation of theVOMSESParser
interface. This class is responsible for parsing VOMSES configuration files and extractingVOMSServerInfo
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 Summary
Fields Modifier and Type Field Description private VOMSESLineParser
lineParser
Line parser used to process individual VOMSES lines.
-
Constructor Summary
Constructors Constructor Description LegacyVOMSESParserImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fileSanityChecks(java.io.File f)
Performs basic sanity checks on the provided file.java.util.List<VOMSServerInfo>
parse(java.io.File f)
Parses a VOMSES file or directory.java.util.List<VOMSServerInfo>
parse(java.io.Reader vomsesReader)
Parses VOMSES configuration from aReader
.protected java.util.List<VOMSServerInfo>
parseDirectory(java.io.File directory)
Parses all VOMSES files in a given directory.protected VOMSServerInfo
parseLine(java.lang.String vomsesLine)
Parses a single line from a VOMSES file.
-
-
-
Field Detail
-
lineParser
private final VOMSESLineParser lineParser
Line parser used to process individual VOMSES lines.
-
-
Method Detail
-
fileSanityChecks
protected void fileSanityChecks(java.io.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(java.lang.String vomsesLine) throws java.net.URISyntaxException
Parses a single line from a VOMSES file.- Parameters:
vomsesLine
- the line to parse- Returns:
- a
VOMSServerInfo
instance representing the parsed line - Throws:
java.net.URISyntaxException
- if the URI in the line is malformed
-
parse
public java.util.List<VOMSServerInfo> parse(java.io.Reader vomsesReader)
Parses VOMSES configuration from aReader
.- Specified by:
parse
in interfaceVOMSESParser
- Parameters:
vomsesReader
- the reader containing VOMSES configuration- Returns:
- a list of
VOMSServerInfo
instances extracted from the input
-
parseDirectory
protected java.util.List<VOMSServerInfo> parseDirectory(java.io.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 java.util.List<VOMSServerInfo> parse(java.io.File f)
Parses a VOMSES file or directory.- Specified by:
parse
in interfaceVOMSESParser
- 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
-
-