Package gov.nasa.pds.tools.validate
Class TargetExaminer
java.lang.Object
gov.nasa.pds.tools.validate.Target
gov.nasa.pds.tools.validate.TargetExaminer
public class TargetExaminer extends Target
Class to examine if a Target maches a certain product type, either a bundle or a collection.
-
Constructor Summary
Constructors Constructor Description TargetExaminer(URL url, boolean isDir)Creates a new instance. -
Method Summary
Modifier and Type Method Description static ArrayList<String>getTargetContent(URL url, String nodeCheck, String fieldCheck, String fieldCheck2)Return the content of the field within a node.static booleanisTargetBundleType(URL url)Check if a given url is of Bundle type.static booleanisTargetCollectionType(URL url)Check if a given url is of Collection type.
-
Constructor Details
-
TargetExaminer
Creates a new instance.
-
-
Method Details
-
isTargetBundleType
Check if a given url is of Bundle type.- Parameters:
url- the url of file to check.- Returns:
- true if the given url is of Bundle type.
-
isTargetCollectionType
Check if a given url is of Collection type.- Parameters:
url- the url of file to check.- Returns:
- true if the given url is of Collection type.
-
getTargetContent
public static ArrayList<String> getTargetContent(URL url, String nodeCheck, String fieldCheck, String fieldCheck2)Return the content of the field within a node.- Parameters:
url- the url of file to check.nodeCheck- the tag of the node to check.fieldCheck- the tag of the field within node to check.fieldCheck2- additional tag of the field within node to check.- Returns:
- the content of the field within a node as string.
-