apuntes:ficheros
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
apuntes:ficheros [2023/05/28 12:04] – [Serialización de objetos] Santiago Faci | apuntes:ficheros [2023/05/28 12:12] (current) – [Files] Santiago Faci | ||
---|---|---|---|
Line 330: | Line 330: | ||
</ | </ | ||
+ | ===== Paquete Java NIO 2 ===== | ||
+ | |||
+ | No includo desde siempre, el paquete Java NIO 2, mejora las clases y métodos disponibles para trabajar con ficheros, sistemas de ficheros y todo lo relacionado con entrada/ | ||
+ | |||
+ | ==== FileSystems ==== | ||
+ | |||
+ | Es una factoría que permite acceder a un sistema de ficheros: | ||
+ | * //static FileSystem getDefault()//: | ||
+ | |||
+ | ==== FileSystem ==== | ||
+ | |||
+ | Representa un sistema de ficheros | ||
+ | |||
+ | * //Path getPath(String first, String. . . more)//: Convierte una ruta en un objeto Path | ||
+ | * //String getSeparator()//: | ||
+ | * // | ||
+ | |||
+ | ==== Paths ==== | ||
+ | |||
+ | Contiene métodos estáticos para obtener objetos Path a partir de cadenas | ||
+ | * //static Path get(String first, String... more)// | ||
+ | |||
+ | ==== Path ==== | ||
+ | |||
+ | Representa un fichero dentro del sistema de ficheros. | ||
+ | Podemos acceder al fichero y a su información a través de las propiedades y métodos de la clase | ||
+ | * //boolean endsWith(String string)// | ||
+ | * //boolean endsWith(Path path)// | ||
+ | * //int getNameCount()// | ||
+ | * //Path getParent()// | ||
+ | * //boolean startsWith(String string)// | ||
+ | * //File toFile()// | ||
+ | * //String toString()// | ||
+ | |||
+ | ==== Files ==== | ||
+ | |||
+ | Contiene métodos estáticos que operan con ficheros y directorios | ||
+ | * //static long copy(. . .)// | ||
+ | * //static Path createFile(. . .)// | ||
+ | * //static void delete(. . .)// | ||
+ | * //static boolean deleteIfExists(Path path)// | ||
+ | * //static Stream< | ||
+ | * //static Stream< | ||
+ | * //static List< | ||
+ | * //static List< | ||
+ | * //static String readString(Path path)// | ||
+ | * //static long size(Path path)// | ||
+ | * //static Stream< | ||
+ | * //static Stream< | ||
---- | ---- | ||
(c) 2019-{{date> | (c) 2019-{{date> |
apuntes/ficheros.1685275478.txt.gz · Last modified: 2023/05/28 12:04 by Santiago Faci