Class Utility


  • public class Utility
    extends Object
    Utility class.
    • Constructor Detail

      • Utility

        public Utility()
    • Method Detail

      • toWellFormedURI

        public static String toWellFormedURI​(String s)
        Convert a string to a URI.
        Parameters:
        s - The string to convert.
        Returns:
        A well-formed URI.
      • getDateTime

        public static String getDateTime()
        Get the current date time.
        Returns:
        A date time.
      • parsePds3Label

        public static gov.nasa.pds.tools.label.Label parsePds3Label​(File label)
                                                             throws Exception
        Throws:
        Exception
      • parsePds3Label

        public static gov.nasa.pds.tools.label.Label parsePds3Label​(URL label)
                                                             throws Exception
        Throws:
        Exception
      • createOutputFile

        public static File createOutputFile​(File file,
                                            File outputDir,
                                            String format)
      • createOutputFile

        public static File createOutputFile​(File file,
                                            File outputDir,
                                            String format,
                                            int index)
      • generate

        public static void generate​(File target,
                                    File outputFile,
                                    String templateName)
                             throws gov.nasa.pds.imaging.generate.TemplateException,
                                    IOException,
                                    gov.nasa.pds.tools.LabelParserException
        Throws:
        gov.nasa.pds.imaging.generate.TemplateException
        IOException
        gov.nasa.pds.tools.LabelParserException
      • generate

        public static void generate​(File target,
                                    File outputFile,
                                    String templateName,
                                    List<String> includePaths)
                             throws gov.nasa.pds.imaging.generate.TemplateException,
                                    IOException,
                                    gov.nasa.pds.tools.LabelParserException
        Throws:
        gov.nasa.pds.imaging.generate.TemplateException
        IOException
        gov.nasa.pds.tools.LabelParserException
      • getHDUIndex

        public static int getHDUIndex​(File fitsFile,
                                      int index)
                               throws nom.tam.fits.FitsException,
                                      IOException
        Gets the HDU index that corresponds to the given index.
        Parameters:
        fitsFile - The FITS file to look for HDUs.
        index - The desired index.
        Returns:
        An HDU index that corresponds to the given index.
        Throws:
        nom.tam.fits.FitsException - If an error occurred reading the FITS file.
        IOException - If the FITS file cannot be read.
      • getSupportedImages

        public static List<gov.nasa.arc.pds.xml.generated.Array> getSupportedImages​(List<gov.nasa.arc.pds.xml.generated.Array> arrays)
        Returns a list of supported image objects.
        Parameters:
        arrays - A list of Array objects to filter.
        Returns:
        A list of supported Array image objects.
      • getImageProperties

        public static ImageProperties getImageProperties​(File pds4Label)
                                                  throws Exception
        Gets image properties associated with the given PDS4 label.
        Parameters:
        pds4Label - A pds4 label to parse.
        Returns:
        An ImageProperties object that contains some image information about the given label.
        Throws:
        Exception - If an error occurred during the parsing process.