@@ -0,0 +1,2447 @@
+package cologne.eck.peafactory.peas.file_pea;%0A/*%0A * Peafactory - Production of Password Encryption Archives%0A * Copyright (C) 2015  Axel von dem Bruch%0A * %0A * This library is free software; you can redistribute it and/or modify it %0A * under the terms of the GNU General Public License as published %0A * by the Free Software Foundation; either version 2 of the License, %0A * or (at your option) any later version.%0A * This library is distributed in the hope that it will be useful, but %0A * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY %0A * or FITNESS FOR A PARTICULAR PURPOSE. %0A * See the GNU General Public License for more details.%0A * See:  http://www.gnu.org/licenses/gpl-2.0.html%0A * You should have received a copy of the GNU General Public License %0A * along with this library.%0A */%0A%0A/**%0A * Generation of the file pea, %0A * not used in the pea itself  %0A */%0A%0A%0Aimport java.io.File;%0A%0Aimport cologne.eck.peafactory.PeaFactory;%0Aimport cologne.eck.peafactory.crypto.CipherStuff;%0Aimport cologne.eck.peafactory.gui.*;%0Aimport cologne.eck.peafactory.peagen.DataType;%0Aimport cologne.eck.peafactory.peagen.JarStuff;%0Aimport cologne.eck.peafactory.tools.WriteResources;%0A%0A%0A%0A%0Apublic class FileType extends DataType %7B%0A%09%0A%09private static byte%5B%5D fileNamesAsBytes = null;%0A%0A%09@Override%0A%09public void processData( byte%5B%5D keyMaterial) %7B%0A%09%09%0A%09%09if (MainView.isBlankPea() == false) %7B%0A%09%09%0A%09%09%09String%5B%5D fileNames = MainView.getFilePanel().getSelectedFileNames();%0A%0A%09%09%09FileTypePanel filePanel = MainView.getFilePanel();%0A%09%09%09%0A%09%09%09filePanel.startProgressTask();// starts if execution %3E 1 second%0A%09%09%09CipherStuff.getCipherMode().encryptFiles(fileNames, keyMaterial, false, filePanel);%0A%09%09%09filePanel.closeProgressTask();// close automatically%0A%09%09%09%0A%09%09%7D else %7B%0A%09%09%09%0A%09%09%09byte%5B%5D cipherBytes = %22uninitializedFile%22.getBytes(PeaFactory.getCharset());%0A%09%09%09%0A%09%09%09String dirName = JarStuff.getJarFileName().substring(0, JarStuff.getJarFileName().length() - 4); // extract %22.jar%22%0A%0A%09%09%09// store cipherBytes beside jar archive:%0A%09%09%09WriteResources.write(cipherBytes, %22text.lock%22, %22peas%22 + File.separator + dirName + File.separator + %22resources%22);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public String getDescription() %7B%0A%09%09return PeaFactory.getLanguagesBundle().getString(%22file_description%22);%0A%09%7D%0A%0A%09@Override%0A%09public String getTypeName() %7B%0A%09%09return %22file%22;%0A%09%7D%0A%0A%09@Override%0A%09public byte%5B%5D getData() %7B%0A%09%09return fileNamesAsBytes;%0A%09%7D%0A%0A%09@Override%0A%09public void setData(byte%5B%5D data) %7B%0A%09%09fileNamesAsBytes = data;%09%09%0A%09%7D%0A%7D%0A

Create FileType.java