čeština v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 15 Dec 2010 18:53:00 +0100
branchv_0
changeset 485fc7f32ef18
parent 3 300e7c9e3d40
child 5 fc93dae7a366
čeština
java/rozsirene-atributy/nbproject/build-impl.xml
java/rozsirene-atributy/nbproject/genfiles.properties
java/rozsirene-atributy/nbproject/project.properties
java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnyVypis.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnýVýpis.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Starter.java
     1.1 --- a/java/rozsirene-atributy/nbproject/build-impl.xml	Wed Dec 15 18:17:15 2010 +0100
     1.2 +++ b/java/rozsirene-atributy/nbproject/build-impl.xml	Wed Dec 15 18:53:00 2010 +0100
     1.3 @@ -291,15 +291,18 @@
     1.4              <attribute default="${build.classes.dir}" name="destdir"/>
     1.5              <sequential>
     1.6                  <fail unless="javac.includes">Must set javac.includes</fail>
     1.7 -                <pathconvert pathsep="," property="javac.includes.binary">
     1.8 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
     1.9                      <path>
    1.10                          <filelist dir="@{destdir}" files="${javac.includes}"/>
    1.11                      </path>
    1.12                      <globmapper from="*.java" to="*.class"/>
    1.13                  </pathconvert>
    1.14 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
    1.15 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
    1.16                  <delete>
    1.17 -                    <files includes="${javac.includes.binary}"/>
    1.18 +                    <files includesfile="${javac.includesfile.binary}"/>
    1.19                  </delete>
    1.20 +                <delete file="${javac.includesfile.binary}"/>
    1.21              </sequential>
    1.22          </macrodef>
    1.23      </target>
     2.1 --- a/java/rozsirene-atributy/nbproject/genfiles.properties	Wed Dec 15 18:17:15 2010 +0100
     2.2 +++ b/java/rozsirene-atributy/nbproject/genfiles.properties	Wed Dec 15 18:53:00 2010 +0100
     2.3 @@ -4,5 +4,5 @@
     2.4  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     2.5  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     2.6  nbproject/build-impl.xml.data.CRC32=ca43bb03
     2.7 -nbproject/build-impl.xml.script.CRC32=26a8ec24
     2.8 -nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45
     2.9 +nbproject/build-impl.xml.script.CRC32=e3e40964
    2.10 +nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
     3.1 --- a/java/rozsirene-atributy/nbproject/project.properties	Wed Dec 15 18:17:15 2010 +0100
     3.2 +++ b/java/rozsirene-atributy/nbproject/project.properties	Wed Dec 15 18:53:00 2010 +0100
     3.3 @@ -63,7 +63,7 @@
     3.4  jnlp.mixed.code=defaut
     3.5  jnlp.offline-allowed=false
     3.6  jnlp.signed=false
     3.7 -main.class=cz.frantovo.rozsireneAtributy.PokusnyVypis
     3.8 +main.class=cz.frantovo.rozsireneAtributy.Pokusn\u00fdV\u00fdpis
     3.9  manifest.file=manifest.mf
    3.10  meta.inf.dir=${src.dir}/META-INF
    3.11  platform.active=default_platform
     4.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnyVypis.java	Wed Dec 15 18:17:15 2010 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,44 +0,0 @@
     4.4 -package cz.frantovo.rozsireneAtributy;
     4.5 -
     4.6 -import java.io.File;
     4.7 -import java.io.IOException;
     4.8 -import java.nio.ByteBuffer;
     4.9 -import java.nio.charset.Charset;
    4.10 -import java.nio.file.Path;
    4.11 -import java.nio.file.attribute.UserDefinedFileAttributeView;
    4.12 -import java.util.List;
    4.13 -
    4.14 -/**
    4.15 - * http://freedesktop.org/wiki/CommonExtendedAttributes
    4.16 - * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user
    4.17 - * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html#so-what-is-a-path-really
    4.18 - *
    4.19 - * $ setfattr -n user.fiki.pozdrav -v 'Dobrý den!' pokus.txt
    4.20 - *
    4.21 - * @author fiki
    4.22 - */
    4.23 -public class PokusnyVypis {
    4.24 -
    4.25 -	/**
    4.26 -	 * Vypíše rozšířené atributy souboru.
    4.27 -	 * @param args pole s jedním prvkem – názvem souboru
    4.28 -	 * @throws IOException
    4.29 -	 */
    4.30 -	public static void main(String[] args) throws IOException {
    4.31 -		File soubor = new File(args[0]);
    4.32 -		Path cesta = soubor.toPath();
    4.33 -		UserDefinedFileAttributeView pohled = cesta.getFileAttributeView(UserDefinedFileAttributeView.class);
    4.34 -		List<String> jmenaAtributu = pohled.list();
    4.35 -		for (String jmenoAtributu : jmenaAtributu) {
    4.36 -			ByteBuffer bajty = ByteBuffer.allocate(pohled.size(jmenoAtributu));
    4.37 -			pohled.read(jmenoAtributu, bajty);
    4.38 -			String hodnotaAtributu = dekoduj(bajty);
    4.39 -			System.out.println(jmenoAtributu + " = " + hodnotaAtributu);
    4.40 -		}
    4.41 -	}
    4.42 -
    4.43 -	private static String dekoduj(ByteBuffer bajty) {
    4.44 -		bajty.flip();
    4.45 -		return Charset.defaultCharset().decode(bajty).toString();
    4.46 -	}
    4.47 -}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnýVýpis.java	Wed Dec 15 18:53:00 2010 +0100
     5.3 @@ -0,0 +1,44 @@
     5.4 +package cz.frantovo.rozsireneAtributy;
     5.5 +
     5.6 +import java.io.File;
     5.7 +import java.io.IOException;
     5.8 +import java.nio.ByteBuffer;
     5.9 +import java.nio.charset.Charset;
    5.10 +import java.nio.file.Path;
    5.11 +import java.nio.file.attribute.UserDefinedFileAttributeView;
    5.12 +import java.util.List;
    5.13 +
    5.14 +/**
    5.15 + * http://freedesktop.org/wiki/CommonExtendedAttributes
    5.16 + * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user
    5.17 + * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html#so-what-is-a-path-really
    5.18 + *
    5.19 + * $ setfattr -n user.fiki.pozdrav -v 'Dobrý den!' pokus.txt
    5.20 + *
    5.21 + * @author fiki
    5.22 + */
    5.23 +public class PokusnýVýpis {
    5.24 +
    5.25 +	/**
    5.26 +	 * Vypíše rozšířené atributy souboru.
    5.27 +	 * @param args pole s jedním prvkem – názvem souboru
    5.28 +	 * @throws IOException
    5.29 +	 */
    5.30 +	public static void main(String[] args) throws IOException {
    5.31 +		File soubor = new File(args[0]);
    5.32 +		Path cesta = soubor.toPath();
    5.33 +		UserDefinedFileAttributeView pohled = cesta.getFileAttributeView(UserDefinedFileAttributeView.class);
    5.34 +		List<String> jménaAtributů = pohled.list();
    5.35 +		for (String jménoAtributu : jménaAtributů) {
    5.36 +			ByteBuffer bajty = ByteBuffer.allocate(pohled.size(jménoAtributu));
    5.37 +			pohled.read(jménoAtributu, bajty);
    5.38 +			String hodnotaAtributu = dekóduj(bajty);
    5.39 +			System.out.println(jménoAtributu + " = " + hodnotaAtributu);
    5.40 +		}
    5.41 +	}
    5.42 +
    5.43 +	private static String dekóduj(ByteBuffer bajty) {
    5.44 +		bajty.flip();
    5.45 +		return Charset.defaultCharset().decode(bajty).toString();
    5.46 +	}
    5.47 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Starter.java	Wed Dec 15 18:53:00 2010 +0100
     6.3 @@ -0,0 +1,13 @@
     6.4 +package cz.frantovo.rozsireneAtributy;
     6.5 +
     6.6 +/**
     6.7 + * Spouštěč programu
     6.8 + * @author fiki
     6.9 + */
    6.10 +public class Starter {
    6.11 +
    6.12 +	public static void main(String[] args) {
    6.13 +		System.err.println("ještě není implementované…");
    6.14 +		System.exit(1);
    6.15 +	}
    6.16 +}