# HG changeset patch # User František Kučera # Date 1292435580 -3600 # Node ID 8183e063968caba013c2fbb8fe40c850025145f0 # Parent 500a16d067e1394425ba3c9c67e1863435adc07a čeština diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/nbproject/build-impl.xml --- a/java/rozsirene-atributy/nbproject/build-impl.xml Wed Dec 15 18:17:15 2010 +0100 +++ b/java/rozsirene-atributy/nbproject/build-impl.xml Wed Dec 15 18:53:00 2010 +0100 @@ -291,15 +291,18 @@ Must set javac.includes - + + + - + + diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/nbproject/genfiles.properties --- a/java/rozsirene-atributy/nbproject/genfiles.properties Wed Dec 15 18:17:15 2010 +0100 +++ b/java/rozsirene-atributy/nbproject/genfiles.properties Wed Dec 15 18:53:00 2010 +0100 @@ -4,5 +4,5 @@ # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=ca43bb03 -nbproject/build-impl.xml.script.CRC32=26a8ec24 -nbproject/build-impl.xml.stylesheet.CRC32=f33e10ff@1.38.2.45 +nbproject/build-impl.xml.script.CRC32=e3e40964 +nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45 diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/nbproject/project.properties --- a/java/rozsirene-atributy/nbproject/project.properties Wed Dec 15 18:17:15 2010 +0100 +++ b/java/rozsirene-atributy/nbproject/project.properties Wed Dec 15 18:53:00 2010 +0100 @@ -63,7 +63,7 @@ jnlp.mixed.code=defaut jnlp.offline-allowed=false jnlp.signed=false -main.class=cz.frantovo.rozsireneAtributy.PokusnyVypis +main.class=cz.frantovo.rozsireneAtributy.Pokusn\u00fdV\u00fdpis manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF platform.active=default_platform diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnyVypis.java --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnyVypis.java Wed Dec 15 18:17:15 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -package cz.frantovo.rozsireneAtributy; - -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.file.Path; -import java.nio.file.attribute.UserDefinedFileAttributeView; -import java.util.List; - -/** - * http://freedesktop.org/wiki/CommonExtendedAttributes - * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user - * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html#so-what-is-a-path-really - * - * $ setfattr -n user.fiki.pozdrav -v 'Dobrý den!' pokus.txt - * - * @author fiki - */ -public class PokusnyVypis { - - /** - * Vypíše rozšířené atributy souboru. - * @param args pole s jedním prvkem – názvem souboru - * @throws IOException - */ - public static void main(String[] args) throws IOException { - File soubor = new File(args[0]); - Path cesta = soubor.toPath(); - UserDefinedFileAttributeView pohled = cesta.getFileAttributeView(UserDefinedFileAttributeView.class); - List jmenaAtributu = pohled.list(); - for (String jmenoAtributu : jmenaAtributu) { - ByteBuffer bajty = ByteBuffer.allocate(pohled.size(jmenoAtributu)); - pohled.read(jmenoAtributu, bajty); - String hodnotaAtributu = dekoduj(bajty); - System.out.println(jmenoAtributu + " = " + hodnotaAtributu); - } - } - - private static String dekoduj(ByteBuffer bajty) { - bajty.flip(); - return Charset.defaultCharset().decode(bajty).toString(); - } -} diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnýVýpis.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/PokusnýVýpis.java Wed Dec 15 18:53:00 2010 +0100 @@ -0,0 +1,44 @@ +package cz.frantovo.rozsireneAtributy; + +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.file.Path; +import java.nio.file.attribute.UserDefinedFileAttributeView; +import java.util.List; + +/** + * http://freedesktop.org/wiki/CommonExtendedAttributes + * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user + * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html#so-what-is-a-path-really + * + * $ setfattr -n user.fiki.pozdrav -v 'Dobrý den!' pokus.txt + * + * @author fiki + */ +public class PokusnýVýpis { + + /** + * Vypíše rozšířené atributy souboru. + * @param args pole s jedním prvkem – názvem souboru + * @throws IOException + */ + public static void main(String[] args) throws IOException { + File soubor = new File(args[0]); + Path cesta = soubor.toPath(); + UserDefinedFileAttributeView pohled = cesta.getFileAttributeView(UserDefinedFileAttributeView.class); + List jménaAtributů = pohled.list(); + for (String jménoAtributu : jménaAtributů) { + ByteBuffer bajty = ByteBuffer.allocate(pohled.size(jménoAtributu)); + pohled.read(jménoAtributu, bajty); + String hodnotaAtributu = dekóduj(bajty); + System.out.println(jménoAtributu + " = " + hodnotaAtributu); + } + } + + private static String dekóduj(ByteBuffer bajty) { + bajty.flip(); + return Charset.defaultCharset().decode(bajty).toString(); + } +} diff -r 500a16d067e1 -r 8183e063968c java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Starter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/java/rozsirene-atributy/src/cz/frantovo/rozsireneAtributy/Starter.java Wed Dec 15 18:53:00 2010 +0100 @@ -0,0 +1,13 @@ +package cz.frantovo.rozsireneAtributy; + +/** + * Spouštěč programu + * @author fiki + */ +public class Starter { + + public static void main(String[] args) { + System.err.println("ještě není implementované…"); + System.exit(1); + } +}