franta-hg@61: /** franta-hg@61: * XML Web generátor – program na generování webových stránek franta-hg@61: * Copyright © 2012 František Kučera (frantovo.cz) franta-hg@113: * franta-hg@61: * This program is free software: you can redistribute it and/or modify franta-hg@61: * it under the terms of the GNU General Public License as published by franta-hg@136: * the Free Software Foundation, version 3 of the License. franta-hg@113: * franta-hg@61: * This program is distributed in the hope that it will be useful, franta-hg@61: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@113: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@61: * GNU General Public License for more details. franta-hg@113: * franta-hg@61: * You should have received a copy of the GNU General Public License franta-hg@113: * along with this program. If not, see . franta-hg@61: */ franta-hg@6: package cz.frantovo.xmlWebGenerator; franta-hg@6: franta-hg@6: import java.io.File; franta-hg@6: import java.net.URI; franta-hg@6: import java.net.URISyntaxException; franta-hg@113: import java.util.Date; franta-hg@6: franta-hg@28: /** franta-hg@76: * Společná knihovna funkcí volaných z XSLT franta-hg@113: * franta-hg@76: * @author František Kučera (frantovo.cz) franta-hg@28: */ franta-hg@6: public class Funkce { franta-hg@87: franta-hg@28: /** franta-hg@28: * Zjištuje, kdy byl naposledy daný soubor změněn. franta-hg@113: * franta-hg@28: * @param soubor cesta k souboru franta-hg@28: * @return datum poslední změny franta-hg@28: * @throws URISyntaxException franta-hg@28: */ franta-hg@21: public static Date posledníZměna(String soubor) throws URISyntaxException { franta-hg@28: URI uri = new URI(soubor); franta-hg@28: File f = new File(uri); franta-hg@28: return new Date(f.lastModified()); franta-hg@21: } franta-hg@113: franta-hg@113: public static String spojText(String[] kusyTextu) { franta-hg@113: if (kusyTextu == null || kusyTextu.length < 1) { franta-hg@113: return null; franta-hg@113: } else { franta-hg@113: StringBuilder sb = new StringBuilder(); franta-hg@113: for (int i = 0; i < kusyTextu.length; i++) { franta-hg@113: sb.append(kusyTextu[i]); franta-hg@113: } franta-hg@113: return sb.toString(); franta-hg@113: } franta-hg@113: } franta-hg@6: }