/* neon-fm - Dateiverwaltung fuer neon Copyright (C) 2024 Ulrich Hilger This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ package de.uhilger.neon.fm; import com.sun.net.httpserver.HttpExchange; import de.uhilger.neon.HttpResponder; import de.uhilger.fm.Eraser; import java.io.IOException; import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author Ulrich Hilger * @version 0.1, 08.11.2024 */ public class FileEraser extends AbstractFileActor { public void run(HttpExchange exchange) { try { init(exchange); String[] dateiNamen = dateiliste(exchange); new Eraser().deleteFiles(fileName, Arrays.asList(dateiNamen), base); antwort(exchange, HttpResponder.SC_OK, "Dateien geloescht."); } catch (IOException ex) { Logger.getLogger(FileEraser.class.getName()).log(Level.SEVERE, ex.getMessage(), ex); } finally { free(); } } }