gov.nasa.pds.search.core.util
Class Utility
java.lang.Object
gov.nasa.pds.search.core.util.Utility
public class Utility
- extends Object
Utility class
- Author:
- jpadams, mcayanan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utility
public Utility()
getDateTime
public static String getDateTime()
- Get the current date time.
- Returns:
- A date time.
getAbsolutePath
public static String getAbsolutePath(String fileType,
String filePath,
boolean isDir)
throws InvalidOptionException
- Method to convert the file path to absolute, if relative, and check if
file exists.
- Parameters:
fileType
- File type denoted to allow for usable error msgsfilePath
- Current path given through the command-lineisDir
- Designates if filePath specified is a directory. False means
filePath is a file.
- Returns:
- the absolute path from the input file path
- Throws:
InvalidOptionException
- thrown if directory does not exist
urlExists
public static boolean urlExists(String url)
execHttpRequest
public static InputStream execHttpRequest(org.apache.http.client.methods.HttpRequestBase request)
throws IOException
- Throws:
IOException
Copyright © 2010-2013 Planetary Data System. All Rights Reserved.