Project

General

Profile

Three methods realization and explanation - Code JAVA

Attention: For better view, all the code pictures are captured by guanji in his git source, you can find the link at the end of the page. Thank you for your comprehension.

1 - Situation1 - One HMI-series to one target .fits file, ex: hmi.m_720s

hmi.m_720s

Define the .fits file name and save the series and filename into hashmap as a fast index, other code in the git source

2 - Situation2 - One HMI-series to multi-targets .fits files, ex: hmi.sharp_720s_nrt

Define all target files into a Arraylist, create new object - FileOrderResource then loop all series and files name into a List<Object> listf which Object = FileOrderResource.

The code is annotated(// or /* */) as we will use the method 3, you can get the source code in the git source here : https://git.ias.u-psud.fr/gwang/Sitools2-V3.0/commits/dev-3

The create a hashmap which key value equals series name and the content equals the filelist,

Use if or switch to set and get the map values for creation of the reference list

3 - Situation3 - Multi HMI-series to multi-targets .fits files

Delete all list and hashmap defined above, in case more or less target files in the target directory,
use the java.io.File to find the target .fits files recursively, don't forget to throw exception and log for analyzing the process of order.
Here is the codes well-encapsulated by guanji :

4 - The creation for the Object - FileOrderResource

It contains 2 elements(reference.getPath(), filename with wave and series information), it is modificable according to the user needs.

5 - When and how to use the 3 method:

  1. If the target files are certain and for saving time, use the first 2 methods.
  2. If the target files are uncertain and too many to define the list, use the last one.

6 - Modification in TarOutputRepresentation and ZipOutputRepresentation

Parse the reference.getpath() and seperate by keywords 'datastorage/user' which is from colUrl in web-admin when administrator define the server service to a dataset

Igore the test logs of GUANJI, he just wanted to make sure all path is well parsed _, the logs can only be appeeared in console logs, no influence to our dear users.

7 - You can find all commits and resources related in the link:

https://git.ias.u-psud.fr/gwang/Sitools2-V3.0/commit/341a4a2f4941fd12384a2bdc37069fb0bdaab596