• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.telephony.tools.sats2;
18 
19 import com.android.storage.tools.block.DumpBlockFile;
20 import com.android.telephony.sats2range.read.SatS2RangeFileReader;
21 import com.android.telephony.tools.sats2.dump.SatS2RangeFileDumper;
22 
23 import java.io.File;
24 
25 /**
26  * Dumps information about a Sat S2 data file. Like {@link DumpBlockFile} but it knows details about
27  * the Sat S2 format and can provide more detailed information.
28  */
29 public final class DumpSatS2File {
30 
31     /**
32      * Usage:
33      * DumpSatFile <[input] sat s2 file name> <[output] output directory name>
34      */
main(String[] args)35     public static void main(String[] args) throws Exception {
36         String satS2FileName = args[0];
37         String outputDirName = args[1];
38 
39         File outputDir = new File(outputDirName);
40         outputDir.mkdirs();
41 
42         File satS2File = new File(satS2FileName);
43         try (SatS2RangeFileReader reader = SatS2RangeFileReader.open(satS2File)) {
44             reader.visit(new SatS2RangeFileDumper(outputDir));
45         }
46     }
47 }
48