public final class DafHandle extends Object
This class has as objective to manage DAF files by their handle. This includes opening, closing and retrieving information about the summary.
Several files may be opened for use simultaneously. (This makes it convenient to combine data from several files to produce a single result.) As each DAF is opened, it is assigned a file handle, which is used to keep track of the file internally, and which is used by the calling program to refer to the file in all subsequent calls to DAF methods.
Currently DAF files can only be opened for read purposes. Writing in a DAF or creating a DAF file is not implemented.
Modifier and Type | Method and Description |
---|---|
static void |
checkHandleAccess(int handle,
String access)
Signal an error if a DAF file handle does not designate a DAF that is open for a specified type of access.
Based on DAFSIH from the SPICE library. |
static void |
closeDAF(int handle)
Close the DAF associated with a given handle.
Based on DAFCLS from the SPICE library. |
static List<Integer> |
getHandleList()
Return a SPICE set containing the handles of all currently open DAFS.
Based on DAFHOF from the SPICE library. |
static int[] |
getSummaryFormatDAF(int handle)
Return the summary format associated with a handle.
Based on DAFHSF from the SPICE library. |
static String |
handleToFilenameDAF(int handle)
Return the name of the file associated with a handle.
Based on DAFHFN from the SPICE library. |
static boolean |
isLoaded(String file,
int[] handle)
Check if a file is already loaded in the DAF Handle structure.
|
static int |
openReadDAF(String filename)
Open a DAF for subsequent read requests.
Based on DAFOPR from the SPICE library. |
public static int openReadDAF(String filename) throws IOException, PatriusException
filename
- Name of DAF to be openedIOException
- if there is a problem opening, reading or closing the filePatriusException
- if there is a problem related with the SPICE algorithmpublic static void closeDAF(int handle) throws PatriusException
handle
- Handle of DAF to be closed.PatriusException
- if there is a problem in the HandleManager closing the filepublic static int[] getSummaryFormatDAF(int handle) throws PatriusException
handle
- Handle of a DAF file.PatriusException
- if the file wasn't opened beforehandpublic static String handleToFilenameDAF(int handle) throws PatriusException
handle
- Handle of a DAF filePatriusException
- if the filename in the HandleManager is emptypublic static boolean isLoaded(String file, int[] handle) throws PatriusException
file
- Path to the file we are interested inhandle
- (out) contains the handle associated to the file if it was loadedPatriusException
- if there is a problem retrieving the information.public static List<Integer> getHandleList()
public static void checkHandleAccess(int handle, String access) throws PatriusException
handle
- HANDLE to be validatedaccess
- String indicating access typePatriusException
- if the access is not correct or the handle not found in the listCopyright © 2023 CNES. All rights reserved.