šablona/funkce/src/cz/frantovo/xmlWebGenerator/Funkce.java
changeset 121 1a32988c4fef
parent 87 25dec6931f18
child 136 d5feb9d8ebc3
     1.1 --- a/šablona/funkce/src/cz/frantovo/xmlWebGenerator/Funkce.java	Sat Jan 14 19:10:26 2012 +0100
     1.2 +++ b/šablona/funkce/src/cz/frantovo/xmlWebGenerator/Funkce.java	Sat Nov 17 23:21:47 2012 +0100
     1.3 @@ -1,36 +1,37 @@
     1.4  /**
     1.5   * XML Web generátor – program na generování webových stránek
     1.6   * Copyright © 2012 František Kučera (frantovo.cz)
     1.7 - * 
     1.8 + *
     1.9   * This program is free software: you can redistribute it and/or modify
    1.10   * it under the terms of the GNU General Public License as published by
    1.11   * the Free Software Foundation, either version 3 of the License, or
    1.12   * (at your option) any later version.
    1.13 - * 
    1.14 + *
    1.15   * This program is distributed in the hope that it will be useful,
    1.16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.17 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    1.19   * GNU General Public License for more details.
    1.20 - * 
    1.21 + *
    1.22   * You should have received a copy of the GNU General Public License
    1.23 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.24 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
    1.25   */
    1.26  package cz.frantovo.xmlWebGenerator;
    1.27  
    1.28  import java.io.File;
    1.29 -import java.util.Date;
    1.30  import java.net.URI;
    1.31  import java.net.URISyntaxException;
    1.32 +import java.util.Date;
    1.33  
    1.34  /**
    1.35   * Společná knihovna funkcí volaných z XSLT
    1.36 - *  
    1.37 + *
    1.38   * @author František Kučera (frantovo.cz)
    1.39   */
    1.40  public class Funkce {
    1.41  
    1.42  	/**
    1.43  	 * Zjištuje, kdy byl naposledy daný soubor změněn.
    1.44 +	 *
    1.45  	 * @param soubor cesta k souboru
    1.46  	 * @return datum poslední změny
    1.47  	 * @throws URISyntaxException
    1.48 @@ -40,5 +41,16 @@
    1.49  		File f = new File(uri);
    1.50  		return new Date(f.lastModified());
    1.51  	}
    1.52 +
    1.53 +	public static String spojText(String[] kusyTextu) {
    1.54 +		if (kusyTextu == null || kusyTextu.length < 1) {
    1.55 +			return null;
    1.56 +		} else {
    1.57 +			StringBuilder sb = new StringBuilder();
    1.58 +			for (int i = 0; i < kusyTextu.length; i++) {
    1.59 +				sb.append(kusyTextu[i]);
    1.60 +			}
    1.61 +			return sb.toString();
    1.62 +		}
    1.63 +	}
    1.64  }
    1.65 -