gov.nasa.pds.search.core.util
Class Utility

java.lang.Object
  extended by gov.nasa.pds.search.core.util.Utility

public class Utility
extends Object

Utility class

Author:
jpadams, mcayanan

Constructor Summary
Utility()
           
 
Method Summary
static InputStream execHttpRequest(org.apache.http.client.methods.HttpRequestBase request)
           
static String getAbsolutePath(String fileType, String filePath, boolean isDir)
          Method to convert the file path to absolute, if relative, and check if file exists.
static String getDateTime()
          Get the current date time.
static List<File> getFileList(String dir, List<String> filePrefixList)
          Utility method to get a list of files from the input directory, based on the list of file prefixes.
static boolean urlExists(String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utility

public Utility()
Method Detail

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 msgs
filePath - Current path given through the command-line
isDir - 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

getFileList

public static List<File> getFileList(String dir,
                                     List<String> filePrefixList)
Utility method to get a list of files from the input directory, based on the list of file prefixes.

Parameters:
dir -
filePrefixList -
Returns:


Copyright © 2010–2014 Planetary Data System. All rights reserved.