Java tutorial
/* * GovPay - Porta di Accesso al Nodo dei Pagamenti SPC * http://www.gov4j.it/govpay * * Copyright (c) 2014-2017 Link.it srl (http://www.link.it). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3, as published by * the Free Software Foundation. * * 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 <http://www.gnu.org/licenses/>. * */ package it.govpay.core.utils; import java.io.File; import java.io.FileInputStream; import java.util.Collection; import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.filefilter.PrefixFileFilter; import it.govpay.model.Canale; import it.govpay.servizi.commons.ModelloPagamento; import it.govpay.servizi.commons.TipoVersamento; public class PspUtils { private static byte[] logoPsp; private static byte[] logoModello; static { logoPsp = Base64.decodeBase64( "iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAn0SURBVGhD7VpZbFTnGT2ze8bjsWc8XrCxxwbb7JtMWOqqjZq2KqQtUdWmm1opaWUIrYDkrSpvbdWH9qF+C3noA6SJRJNQHrBpiQTEMpQgaIugAWxMAe/7Mos9a8/33ztex04HE9WDOPKdO/ff7vznfvu1IUHgCWFyMoDe7gdYWb4GRqNJb3268QQITKDx9Dvo7ulFTU0NvF4vRkdG0NPbi7Lylajd8YI+7unEkgj0+wdx4/oVjI6NoaSkhOdRmEwmmE1m5OS40NvTjTKfD77KDbBYbPqspwuPRWAkHMK91hv4+O+XYXc44asop/qGUVxcDKvVhrHRUQwM9MPtycejRw+QZbNi05bnUFyySl/h6UFaBI4O9+DqlWYkDAYUeAtI1BglLQdutxupljFwXDelUM4ulwv9/f3I9+ajqmYLsrKc+qjMxv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p25jQAbjZxkCoIMBaySzJS9n8E2BYdy3iZqVIyx5nlOeA9b/XZbnFmBcVrMzM9rzon2a+emsdu3cxAJ/jAAzZKytw/l1Q03A806xX01++H2/pdm1oj78wXdpx4aNwa8WcRe7zzmHRNtR2IAFJx/m4G95wgoIk3bADJuhJgisD9/JAHLYnRn6S9iFSQSZ3Vd4h0IfPsbeuKVPg5296porbvcH3P4u2F8gffObf6cXX3a9dmz2kgXhKRYlx7lztBFv+YRP0/IqUueXUQXMNO+o4OaO0CFKA6qBG0TsFEjOh0dKsVgAvDmNbdiMAHXSk92h37AThPChGATGzTGu3YyzJd/6hVfeoJknf6C7v/C3uvTyl2lkFOug3snx2MQG3Ei6I+4va/zZsnckid9MCyIwfIY5hFkG5do/2824jS/JIwIz6MObCvST9bkDIHPxHLP4GrfN3nj9q27vgGQL23/4kUf1k4UFve2tN2u0aEEcHWEhnZiBee9qGCw6QXY6oVN3Y0CCvPyX2PkZuHWsC3VI7uK2g+IPKjdu3aSJqTGVxiaocT/uw234eYYcLJar8wXmBAvcs5scuOJqjeXquuPOv9Bll12uqfGR4Ptq+OVsoYRFWQazkG4Bxa7VHRnY1Cc7iSKVcirAtUd1MMtyDX8DyDyNoIAV6mmdyae7b+AQAuSBn73i9qdOnNTMqTmVGfjOP/64ztq5mU7dHY0wU79fLfoBHnQn6ba+i2dicTiGBNrXBJZwPQDWZQjm+jq3oaRP+zwdL0jpvrJcezeciYd3KZicmZkjhSEZIioiIm3Pv2CfLt1/nt7zwY/oxfsv1oYN40HYRq2Kb8togkCTcQT2m0EszGP5k1HvLQYNGeAwMhmkQUUzBtUuwUc3sbgJOFCJKRrIXPhEL8lk9H8A5sEET2GaHswAAAAASUVORK5CYII="); } public static TipoVersamento toWeb(Canale.TipoVersamento tipoVersamento) { return TipoVersamento.fromValue(tipoVersamento.getCodifica()); } public static ModelloPagamento toWeb(Canale.ModelloPagamento modelloVersamento) { return ModelloPagamento.fromValue(modelloVersamento.name()); } public static byte[] getLogo160(String codPsp) { return getLogo("160x80", codPsp); } public static byte[] getLogo80(String codPsp) { return getLogo("80x40", codPsp); } private static byte[] getLogo(String subFolder, String codPsp) { try { Collection<File> logos = FileUtils.listFiles( new File(GovpayConfig.getInstance().getLogoDir() + File.pathSeparator + subFolder), new PrefixFileFilter(codPsp), null); File logo = logos.iterator().next(); return IOUtils.toByteArray(new FileInputStream(logo)); } catch (Throwable t) { return logoPsp; } } public static byte[] getLogo(Canale.ModelloPagamento modelloPagamento) { return logoModello; } }