public class Utility extends Object
| Constructor and Description |
|---|
Utility() |
| Modifier and Type | Method and Description |
|---|---|
static File |
createOutputFile(File file,
File outputDir,
String format) |
static File |
createOutputFile(File file,
File outputDir,
String format,
int index) |
static void |
exec(File program,
String[] args) |
static void |
generate(File target,
File outputFile,
String templateName) |
static void |
generate(File target,
File outputFile,
String templateName,
List<String> includePaths) |
static String |
getDateTime()
Get the current date time.
|
static gov.nasa.arc.pds.xml.generated.FileAreaObservational |
getFileArea(File pds4Label,
String dataFile) |
static List<gov.nasa.arc.pds.xml.generated.FileAreaObservational> |
getFileAreas(File pds4Label) |
static List<gov.nasa.arc.pds.xml.generated.FileAreaObservational> |
getFileAreas(URL pds4Label) |
static File |
getFileFromURL(URL url,
File outputDir) |
static int |
getHDUIndex(File fitsFile,
int index)
Gets the HDU index that corresponds to the given index.
|
static ImageProperties |
getImageProperties(File pds4Label)
Gets image properties associated with the given PDS4 label.
|
static ImageProperties |
getImageProperties(URL pds4Label) |
static URL |
getParent(URL url) |
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.
|
static gov.nasa.pds.tools.label.Label |
parsePds3Label(File label) |
static gov.nasa.pds.tools.label.Label |
parsePds3Label(URL label) |
static URL |
toURL(String s)
Convert a string to a URL.
|
static String |
toWellFormedURI(String s)
Convert a string to a URI.
|
public static URL toURL(String s) throws MalformedURLException
s - The string to convertMalformedURLExceptionpublic static String toWellFormedURI(String s)
s - The string to convert.public static String getDateTime()
public static gov.nasa.pds.tools.label.Label parsePds3Label(File label) throws Exception
Exceptionpublic static gov.nasa.pds.tools.label.Label parsePds3Label(URL label) throws Exception
Exceptionpublic static List<gov.nasa.arc.pds.xml.generated.FileAreaObservational> getFileAreas(File pds4Label) throws gov.nasa.pds.objectAccess.ParseException, MalformedURLException, URISyntaxException
gov.nasa.pds.objectAccess.ParseExceptionMalformedURLExceptionURISyntaxExceptionpublic static List<gov.nasa.arc.pds.xml.generated.FileAreaObservational> getFileAreas(URL pds4Label) throws gov.nasa.pds.objectAccess.ParseException, MalformedURLException, URISyntaxException, IOException
gov.nasa.pds.objectAccess.ParseExceptionMalformedURLExceptionURISyntaxExceptionIOExceptionpublic static gov.nasa.arc.pds.xml.generated.FileAreaObservational getFileArea(File pds4Label, String dataFile) throws gov.nasa.pds.objectAccess.ParseException, MalformedURLException, URISyntaxException
gov.nasa.pds.objectAccess.ParseExceptionMalformedURLExceptionURISyntaxExceptionpublic static File createOutputFile(File file, File outputDir, String format, int index)
public static void exec(File program, String[] args) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic static void generate(File target, File outputFile, String templateName) throws Exception
Exceptionpublic static void generate(File target, File outputFile, String templateName, List<String> includePaths) throws Exception
Exceptionpublic static int getHDUIndex(File fitsFile, int index) throws nom.tam.fits.FitsException, IOException
fitsFile - The FITS file to look for HDUs.index - The desired index.nom.tam.fits.FitsException - If an error occurred reading the FITS file.IOException - If the FITS file cannot be read.public static List<gov.nasa.arc.pds.xml.generated.Array> getSupportedImages(List<gov.nasa.arc.pds.xml.generated.Array> arrays)
arrays - A list of Array objects to filter.public static ImageProperties getImageProperties(File pds4Label) throws Exception
pds4Label - A pds4 label to parse.Exception - If an error occurred during the parsing
process.public static ImageProperties getImageProperties(URL pds4Label) throws Exception
Exceptionpublic static File getFileFromURL(URL url, File outputDir) throws Exception
Exceptionpublic static URL getParent(URL url) throws MalformedURLException, URISyntaxException
Copyright © 2022 Planetary Data System. All rights reserved.