Loading src/main/java/ecorp/easy/installer/models/PreparationProcess.java 0 → 100644 +57 −0 Original line number Diff line number Diff line /* * Copyright 2021-2022 - ECORP SAS * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package ecorp.easy.installer.models; import ecorp.easy.installer.models.RomSource; import java.util.HashMap; /** * This class encapsulate data about process to prepare a device before flashing * @author vincent Bourgmayer */ public class PreparationProcess extends Process{ private final HashMap<String, RomSource> sourcesToDownload; /** * Constructor of PreparationProcess * * @param stepCount number of step in the process */ public PreparationProcess(int stepCount){ super(stepCount); sourcesToDownload = new HashMap<>(); } /** * Get the list of file to download * @return HashMap<String, RomSource> */ public final HashMap<String, RomSource> getSourcesToDownload() { return sourcesToDownload; } /** * Add a source to download * @param key the key associated to the RomSource instance * @param source The source to Download */ public void putSourceToDownload(String key, RomSource source){ sourcesToDownload.put(key, source); } } No newline at end of file src/main/java/ecorp/easy/installer/models/RomSource.java 0 → 100644 +55 −0 Original line number Diff line number Diff line /* * Copyright 2021-2022 - ECORP SAS * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package ecorp.easy.installer.models; /** * This class encapsulate data about rom sources to download (ROM & recovery images, patch, ...) * This is used to map data from config file * @author vincent Bourgmayer */ public class RomSource { private final String url; //where to get the file private final String fileName; //the file name //private String checksum; //@TODO complete: Doesn't remember yet if it is Checksum value or checksum extension or checksum path /** * Constructor or RomSource instance * @param url Url to use to download file * @param fileName file name */ public RomSource(String url, String fileName){ this.url = url; this.fileName = fileName; } /** * Get url to download the file * @return String url like: https://<anyURL> */ public String getUrl() { return url; } /** * Local path to the file * @return */ public String getFileName() { return fileName; } } Loading
src/main/java/ecorp/easy/installer/models/PreparationProcess.java 0 → 100644 +57 −0 Original line number Diff line number Diff line /* * Copyright 2021-2022 - ECORP SAS * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package ecorp.easy.installer.models; import ecorp.easy.installer.models.RomSource; import java.util.HashMap; /** * This class encapsulate data about process to prepare a device before flashing * @author vincent Bourgmayer */ public class PreparationProcess extends Process{ private final HashMap<String, RomSource> sourcesToDownload; /** * Constructor of PreparationProcess * * @param stepCount number of step in the process */ public PreparationProcess(int stepCount){ super(stepCount); sourcesToDownload = new HashMap<>(); } /** * Get the list of file to download * @return HashMap<String, RomSource> */ public final HashMap<String, RomSource> getSourcesToDownload() { return sourcesToDownload; } /** * Add a source to download * @param key the key associated to the RomSource instance * @param source The source to Download */ public void putSourceToDownload(String key, RomSource source){ sourcesToDownload.put(key, source); } } No newline at end of file
src/main/java/ecorp/easy/installer/models/RomSource.java 0 → 100644 +55 −0 Original line number Diff line number Diff line /* * Copyright 2021-2022 - ECORP SAS * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package ecorp.easy.installer.models; /** * This class encapsulate data about rom sources to download (ROM & recovery images, patch, ...) * This is used to map data from config file * @author vincent Bourgmayer */ public class RomSource { private final String url; //where to get the file private final String fileName; //the file name //private String checksum; //@TODO complete: Doesn't remember yet if it is Checksum value or checksum extension or checksum path /** * Constructor or RomSource instance * @param url Url to use to download file * @param fileName file name */ public RomSource(String url, String fileName){ this.url = url; this.fileName = fileName; } /** * Get url to download the file * @return String url like: https://<anyURL> */ public String getUrl() { return url; } /** * Local path to the file * @return */ public String getFileName() { return fileName; } }